Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP IIF() function replacement
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00847773
Message ID:
00847775
Views:
14
>In VFP I could do:
>
>SELECT IIF(EMPTY(field1),field2,field1) AS field...
>
>to pull data conditionally in from either field between two fields in a table. Is there a way to do this in MSSQL? TIA.

You would use CASE function.
SELECT CASE WHEN LEN(field1)=0 THEN field2 ELSE field1 END AS field...
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform