Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
From
03/06/2002 11:11:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00664067
Message ID:
00664072
Views:
30
Thanks!

>>Hi:
>>
>>I have the following SQL statement that returns an error:
>>
>>column ai_acprim not found
>>
>>If I change the ORDER BY clause to read:
>>
>>
>>ORDER BY AcctInfo.ai_acprim cn_lname, cn_fname ;
>>
>>
>>then there is no error! What is wrong with my ORDER BY clause?
>>
>>Thanks,
>>
>>Yossi
>>
>>
>>
>>SELECT Client.cn_primary, Client.cn_fname, Client.cn_lname, ;
>>	Acctinfo.ai_cnprim, ;
>>	Acctinfo.ai_acprim, Acctinfo.ai_dateent, Acctinfo.ai_dateext, ;
>>	Trans.tr_amt, Trans.tr_date, Trans.tr_acfrom, Assetc.ac_desc ;
>>	FROM  pf!client ;
>>	INNER JOIN pf!acctinfo ;
>>	ON  Client.cn_primary = Acctinfo.ai_cnprim ;
>>	INNER JOIN pf!assetc ;
>>	ON  Acctinfo.ai_acprim = Assetc.ac_primary ;
>>	INNER JOIN pf!TRANS ;
>>	ON  Acctinfo.ai_cnprim = TRANS.tr_cnprim ;
>>	AND  Acctinfo.ai_acprim = TRANS.tr_acprim ;
>>	WHERE ASCAN(laAcPrim,Acctinfo.ai_acprim) > 0 ;
>>	AND (EMPTY(Acctinfo.ai_dateext) OR  Acctinfo.ai_dateext >= DATE(2001,1,1)) ;
>>	AND Trans.tr_type = 'T' ;
>>	AND Trans.tr_date >= DATE(1995,1,1) ;
>>	ORDER BY AcctInfo.ai_acprim, YEAR(tr_date), MONTH(tr_date), cn_lname, cn_fname ;
>>	INTO CURSOR curs1
>>
>
>You can not use VFP functions in order by clause. You will have to add these fields to your select statement and sort by them.
Previous
Reply
Map
View

Click here to load this message in the networking platform