Hi Nevashan,
Please give this a try:
Select MAX(t0.DocNum) AS LatestDocNum,
t0.CardCode,
t0.ShipToCode,
(select DocDate from OINV where DocNum = MAX(t0.DocNum))
From OINV t0
WHERE t0.CardCode = [%0]
Group by t0.CardCode,
t0.ShipToCode
Regards,
Johan
Hi Nevashan,
Please give this a try:
Select MAX(t0.DocNum) AS LatestDocNum,
t0.CardCode,
t0.ShipToCode,
(select DocDate from OINV where DocNum = MAX(t0.DocNum))
From OINV t0
WHERE t0.CardCode = [%0]
Group by t0.CardCode,
t0.ShipToCode
Regards,
Johan