Home Forums SQL Server 7,2000 T-SQL Case statement imbedded under another case statement RE: Case statement imbedded under another case statement

  •   sum( case dbo.D_VEHICLE_STATUS.LIFECYCLE_STATUS_CODE

    when '0'      then   dbo.F_VEHICLE_STATUS.VEHICLE_STATUS_UNITS

     else sum(

             ( case when dbo.D_PORT.PHYSICAL_PORT_CODE = 'PMA' then

                dbo.F_VEHICLE_STATUS.VEHICLE_STATUS_UNITS

      else 0 end  )    end )

     

    every case must have a end.

     


    -- Amit



    "There is no 'patch' for stupidity."



    Download the Updated SQL Server 2005 Books Online.