Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Immediate IF
Message
From
28/07/1999 10:47:24
 
 
To
27/07/1999 19:28:57
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00246933
Message ID:
00247150
Views:
35
> I am currently using ASP against a SQL 7 server for data display. In FoxPro, I can use an IIF statement to set a variable value according to the evaluation of the IIF statement.
>i.e. that = IIF(thing = 'N', "No", "Yes")
>
>Is there such a function in SQL? Or will I be doing Begin, If, Else, End
statements?

Look at the CASE expression in the SQL Server Books Online

DECLARE @t int
SELECT @t = CASE WHEN condition1 THEN value1 ELSE value 2 END

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform