Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to execute SQL in DESC order?
Message
From
24/07/2001 07:52:00
 
 
To
24/07/2001 07:43:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00534288
Message ID:
00534303
Views:
15
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
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform