Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement
Message
 
 
À
03/06/2002 10:57:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00664067
Message ID:
00664068
Vues:
21
>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform