Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Being Stupid about SQL statement
Message
From
25/01/2001 13:06:03
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00468592
Message ID:
00468622
Views:
18
I would suggest aliasing your tables. If you use table aliases you can avoid the reserved word problem. Also I think that the distinction between the number field in the main query and the number field in the subquery is unclear.
By aliasing the incoming and receipts tables you can reference the fields by table.

>This is absolutely not the case. I use WHERE clauses in subqueries all the time. I'm betting the use of number,date and type as field names and as the ORDER BY criterion is what's is causing the trouble. These are all reserved words in VFP.
>
>>Okay, being stupid, appears that a where clause is invalid in a subquery.
>>
>>
>>
>>>In VFP 5.0 I seem to be having a problem with a subquery. I can run the subquery stand alone and it works fine. Please someone tell me what I'm not seeing.
>>>
>>>****
>>>
>>>SELECT uniqueid,number,date,type,sn,payee1,document from incoming ;
>>> where BETWEEN(date,Thisform.sdate.value,thisform.edate.value) ;
>>> and number NOT IN (Select number from receipts ;
>>> where BETWEEN(letterdate,Thisform.sdate.value,thisform.edate.value) ;
>>> and lettertype = [I]) ;
>>> order by number ;
>>> into cursor curLetter NOFILTER NOCONSOLE
>>>
>>>*****
>>>
>>>Ideas?
Wine is sunlight, held together by water - Galileo Galilei
Un jour sans vin est comme un jour sans soleil - Louis Pasteur
Water separates the people of the world; wine unites them - anonymous
Wine is the most civilized thing in the world - Ernest Hemingway
Wine makes daily living easier, less hurried, with fewer tensions and more tolerance - Benjamin Franklin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform