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:
01444591
Vues:
35
>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(Ltrim(RQ.RQ_MOSJOB)) > 0 
                   then "Work Order" 
                   else 
                        case when len(lTrim(RQ.RQ_MOCNUMBER)) > 0 
                                    then "Customer Order" 
                                    else "Other" END
                END as [Reqt Type]
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform