Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to execute SQL in DESC order?
Message
De
24/07/2001 08:07:32
 
 
À
24/07/2001 07:52:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00534288
Message ID:
00534305
Vues:
11
Do you realise the order by statement will order by ascending by deasult?
So in your 3rd SQL statement
>SELECT * FROM csrInvoice ;
>GROUP BY InvDate, INo ;
>HAVING THIS.Include(Qty, StockQty, @lnCount, @lnSum) ;
>ORDER BY InvDate, INo desc;
>INTO CURSOR csrInvoice
This will order by InvDate Ascending then Ino Descending

Try
>SELECT * FROM csrInvoice ;
>GROUP BY InvDate, INo ;
>HAVING THIS.Include(Qty, StockQty, @lnCount, @lnSum) ;
>ORDER BY InvDate Desc, INo desc;
>INTO CURSOR csrInvoice
Is this what you mean?

Will

>Hi
>Any comments?
>
>
>LOCAL lnCount, lnSum
>
>STORE 0 TO lnCount, lnSum
>
>SELECT d.InvDate, d.InvNo, d.INo, d.CPU, d.Qty, d.LocCode ;
>FROM tblP_InvDetails d ;
>ORDER BY InvDate DESC ;
>INTO CURSOR csrInvoice
>BROW
>
>SELECT * FROM CSRINVOICE
>
>SELECT p.InvNo, p.InvDate, p.INo, p.CPU, p.Qty, v.Qty AS StockQty ;
>FROM csrValuation v, csrInvoice p ;
>WHERE v.INo == p.INo AND v.LocCode == p.LocCode ;
>ORDER BY InvDate DESC ;
>INTO CURSOR csrInvoice
>
>SELECT * FROM csrInvoice ;
>GROUP BY InvDate, INo ;
>HAVING THIS.Include(Qty, StockQty, @lnCount, @lnSum) ;
>ORDER BY InvDate, INo desc;
>INTO CURSOR csrInvoice
>
>
>PROCEDURE Include
>LPARAMETER tnPQty, tnQty, tnCount, tnSum
>
>tnSum = tnSum + tnPQty
>
>IF tnSum > tnQty
>	tnCount = tnCount + 1
>	IF tnCount > 1
>		RETURN .F.
>	ENDIF
>ENDIF
>
>RETURN .T.
>
>ENDPROC
>
>
Will Jones
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform