Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF statement
Message
De
24/09/2001 16:18:06
 
 
À
24/09/2001 16:06:37
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00560189
Message ID:
00560203
Vues:
27
>In my Access query I was using IIf statement, now SQL doesn't like that. How I can replace it ?

Check out CASE: (edited this sample from the docs)
SELECT Category = 
        CASE type
            WHEN 'popular_comp' THEN 'Popular Computing'
            WHEN 'mod_cook' THEN 'Modern Cooking'
            ELSE 'Not yet categorized'
        END
FROM myTable
HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform