Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL 101 (again)
Message
From
23/07/2002 14:57:14
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00681356
Message ID:
00681820
Views:
34
This message has been marked as the solution to the initial question of the thread.
Ashley

I am not sure about Access but in a SQL database use have to use ' around strings.
?SQLexec(nFileHandle,"select * from EMPLOYEE where EMPID in ('ABCO','CALPE','BEBO')",'EMPINFO')
>Hi Al,
>
>Tried this with no luck (returns -1 if I add the WHERE .. IN clause, 1 - success if I remove it)
>
?SQLexec(nFileHandle,'select * from EMPLOYEE where EMPID in ("ABCO","CALPE","BEBO")','EMPINFO')
>>>Thanks for the response, Al.
>>>Could you give me an example of the 'IN' syntax?
>>
>>From VFP7 help for SELECT - SQL, Example 7:
Example 7 displays FilterCondition in the form of FieldName [NOT] IN Value_Set
>>
>>When the filter condition includes IN, the field must contain one of the values before its record is included in the query results.
>>
>>customer.postalcode NOT IN ("98052","98072","98034")
This example uses character values. If your case uses numeric values, remove the quotes. You would typically build the entire SELECT command as a string variable and pass that as one of the parameters to your SQLEXEC() function call.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform