Select CustomerNumber, InvoiceDate, OtherStuff ; From lcCursor a1; Where a1.InvoiceDate In ; (Select Max(b1.InvoiceDate); From lcCursor b1 ; Where B1.CustomerNumber = A1.CustomerNumber); Into Cursor C_NewResultSingleInvoice
>select a1.*; > from lcCursor a1; > where a1.InvNo IN ; > ( select Max( b1.Invno ); > from lcCursor b1 ); > into cursor C_NewResultSingleInvoice>>I need to list the last items purchased by customer.
>>SELECT INVNO,; >> .... >> INVDTE,; >> FROM (lcDirectory + 'ARTRAN01') tran1 ; >> WHERE currhist = " " ; >>UNION ALL; >>..... >>into cursor lcCursor