Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF statement
Message
From
24/09/2001 16:18:06
 
 
To
24/09/2001 16:06:37
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00560189
Message ID:
00560203
Views:
26
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform