Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Returning Less Than Desired
Message
 
To
19/07/2001 16:21:35
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00532833
Message ID:
00533060
Views:
16
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
Previous
Reply
Map
View

Click here to load this message in the networking platform