Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement How To?
Message
From
26/02/2006 16:26:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL Statement How To?
Miscellaneous
Thread ID:
01099289
Message ID:
01099289
Views:
65
I need to list the last items purchased by customer. The sales transaction data is stored two separate files ARTRAN(Current Invoice Transactions) and ARYTRN(History Invoice Transactions). I have been able to create one cursor with data from the current and history files.(See Attached) How can I modify this to only retrieve items from the last invoice?

lcDirectory = "D:\demo\pro73\data01\"
lcCursor = "Report"

SELECT INVNO,;
ITEM,;
CUSTNO,;
LOCTID,;
DESCRIP,;
COST,;
PRICE,;
QTYORD,;
QTYSHP,;
INVDTE,;
EXTPRICE,;
CURRHIST ;
FROM (lcDirectory + 'ARTRAN01') tran1 ;
WHERE currhist = " " ;
UNION ALL;
SELECT INVNO,;
ITEM,;
CUSTNO,;
LOCTID,;
DESCRIP,;
COST,;
PRICE,;
QTYORD,;
QTYSHP,;
INVDTE,;
EXTPRICE,;
CURRHIST ;
FROM (lcDirectory + 'ARYTRN01') ytrn1 ;
into cursor lcCursor
Next
Reply
Map
View

Click here to load this message in the networking platform