General information
Category:
Coding, syntax & commands
Title:
SQL Statement How To?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only