Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using IIF() function in SQL command
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00212178
Message ID:
00212207
Views:
26
>It seems if you use an IIF() statement in a SQL command, it is evaluated only once instead of for each record. For example:
>
>SELECT IIF(column1=.T.,column2,column3) etc...
>
>This will pull all column2 or column3 in the resulting cursor but not combination of each depending upon the value of column1 in each record. Is there a way to do this to pull from both column2 and column3 depending upon value of column1? I must be missing something abvious.
>
>TIA

John,

Ed gave you answer, I do, however, want to mention that you can improve the performance of the query (and simplify it as well) by using SELECT IIF(column1, column2, column3).
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform