Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of IIF in SQL command
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00576218
Message ID:
00576247
Views:
16
I can not explain it but it is not related to iif(), but rather to WHERE.
This works properly:
*--------------------
sele * from .... where iHi(supplier_id)
*>>>
Procedure iHi
Parameter pp
return !iif(pp <" 10",.t.,.f.)
*---------------------------------



>Can somebody explain the following?
>
>Taking the Tastrade sample:
>Type the following in to the command window:
> SELECT * from supplier WHERE IIF(supplier_id < " 10",.T.,.F.)
>
>You get the records with ID's of 1 to 9
>
>If you add a not to it:
>SELECT * from supplier WHERE !IIF(supplier_id < " 10",.T.,.F.)
>
>I know that the expression "IIF(xxx,.T.,.F.)" is as even more pointless than "IF xxx = .T." but it was actually generated by a querying tool we have written. Of course, I could fix the problem, but I am intrigued since I am pretty sure that I am up against my own ignorance rather than a bug. Any intelligible explanation would be gratefully received!
Previous
Reply
Map
View

Click here to load this message in the networking platform