Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Create This CASE Statement
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01444588
Message ID:
01444703
Vues:
41
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform