Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of IIF in SQL command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00576218
Message ID:
00576247
Vues:
18
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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform