Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I...
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00438564
Message ID:
00439205
Views:
11
>>>In VFP, if I have a logical field, I can do something like this:
>>>
>>>select iID, iif(lLogical, 'Open', 'Closed') from sometable
>>>
>>>This will return the word Open or Closed depending on the value of lLogical.
>>>
>>>Since SQL Server does not have an IIF function, how do I do the same thing using Transact SQL?
>>
>>HI,
>>
>>You can use the CASE construct in SQL, i.e.
>>
>>SELECT CASE WHEN bLogical = 1 THEN 'True' ELSE 'False' END as Choice FROM Table
>
>Do you include the END with T-SQL, or just use END with a corresponding BEGIN?


The END is a part of CASE (See BOL).
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform