Skip to Content

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

Query Help

I am in need of a query that will isolate the invoices posted between the first day of the year through the check date run (variable) , which they have the same invoice number.

Can anyone help me?

Former Member
Former Member replied

Hi,

Try this:

SELECT T0.DocNum 'Invoice#', T0.DocDate, T0.DocTotal, T0.PaidToDate, T1.DocNum 'Payment#', T2.DocDate

FROM OPCH T0

INNER JOIN VPM2 T1 ON T1.DocEntry=T0.DocEntry

INNER JOIN OVPM T2 ON T2.DocEntry=T1.DocNum AND T2.CheckSum > 0

WHERE Year(T0.DocDate)=Year(GetDate()) AND T2.DocDate < [%0\]

Thanks,

Gordon

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question