Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

last date of invoice in report

Dear experts,

could you help me with inserting right column" last date of document" in this query?

Thank you in advance,

jonmar7

SELECT DISTINCT T0.[CardCode], T0.[CardName], T2.[SlpName], T4.[ItmsGrpNam],

(SELECT TOP 1 T1.DocDate AS 'Last DocDate'

FROM OINV T1

ORDER BY T1.DocDate DESC )

, T3.[Discount] FROM [dbo].[OCRD] T0 INNER JOIN OINV T1 ON T0.CardCode = T1.CardCode INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode INNER JOIN OSPG T3 ON T0.CardCode = T3.CardCode, OITB T4 WHERE T4.[ItmsGrpCod] = T3.[ObjKey] AND T2.[SlpName] =[%0] order by T0.[CardCode], T4.[ItmsGrpNam]

Former Member
Not what you were looking for? View more on this topic or Ask a question