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?
Gordon Du replied
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\]