Good day all
I need to write a query that pulls ONLY the last invoice for each ShipToCode from each CardCode using the OINV table.
Any ideas on a query that I can write to do this.I have written something like this but get the aggregate function error for a few fields in the select statement. Please help on making this work
Select
DocNum,
CardCode,
ShipToCode,
DocDate
From
OINV
WHERE
CardCode = [%0]
ORDER BY
DocDate DESC
Group by
ShipToCode
Many thanks and Regards
Nevashan