Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Create This CASE Statement
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01444588
Message ID:
01444703
Views:
40
>>How do you convert this to a CASE in SQL?
>>
>>
>>IIf(Trim(RQ.RQ_MOSJOB)<>"","Work Order",IIf(Trim(RQ.RQ_MOCNUMBER)<>"","Customer Order","Other")) AS [Reqt Type], 
>>
>>
>>Thanks
>
>
>CASE WHEN LEN(RQ.RQ_MOSJOB) > 0
>          THEN 'Work Order'
>     WHEN LEN(RQ.RQ_MOCNUMBER) > 0
>          THEN 'Customer Order'
>     ELSE 'Other'
>END
>
I like the formatting. Usually I see CASE statements spread out across one line and always seem to have to look at them twice that way.
Previous
Reply
Map
View

Click here to load this message in the networking platform