Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server Syntax IIF()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053526
Message ID:
00053531
Views:
21
>I just ported my data to SQL Server 6.5 and I was wondering if there is any substitute for the IIF() that I used in a few views. For example: Select Site_ID,IIF(Flag="X","Passed","Failed") From xTable.
>
>Any clues are appreciated. tia

Use 'CASE' (I am not sure that I remember right syntax) :
Select 'newfield'=CASE When Flag="X" Then "Passed" Else "Failed" End
From xTable
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform