Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement