Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Returning Less Than Desired
Message
 
À
19/07/2001 16:21:35
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00532833
Message ID:
00533060
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>>Try instead of IN:
<>SELECT DISTINCT ;
>> Codes.type, Codes.code, Codes.subsystem ;
<> FROM codes ;
>> WHERE ","+ALLTRIM(STR(Codes.subsystem))+"," $ (?csubsystem)

>Um, ok... that worked! Why?
Because IN is a function similar to INLIST, that requre a list of expressions(unlike $ operator). To see the difference in your case try :
[...where fieldvalue IN (",1,", ",2,", ",3,")] instead of
[...where fieldvalue IN (",1,2,,3,")].

To avoid confusion I personally use these three functions in three different situations: $ - to choose from the string, INLIST - to chose from the list of expressions, and IN - in Select statement with subquery in WHERE clause.

>I'm using the view designer, how do I get it to use the $ instead of IN?
You can modify View SQL statement as desired.

Good luck
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform