Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF in SqlServer and Overview for SQL server Functions
Message
From
25/06/2003 10:36:58
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00803735
Message ID:
00803785
Views:
12
Patrick,

>1 - I am searching for something in SqlServer that is similar to IIF in the Fox syntax. I need to retrieve a string via SqlExec from Sql-Server where one field should be composed by RTRIM(firstname)+RTRIM(Lastname) and in between a space "IIF" firstname is empty.

Others have pointed you to the CASE command in T-SQL, which can be used in the SELECT statement. In addition, you can create User-Defined Functions (UDFs) in SQL Server for functions, calculations, tests, and other conditional processing that you might want to reuse in multiple queries.

Dan Jurden's whitepaper takes you through the details of how to do that:

http://www.eps-cs.com/pdf/whitepaper_sqlUDFs.pdf
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform