Credit notes and AP Invoices
I would like a query for AP credit memo's and AP invoices in the one query - assistance would be greatly appreciated.
Gordon Du replied
Please check this one and let me know what error messages if any:
SELECT DISTINCT T3.DocNum as 'Credit Note#', T3.DocDate as 'CRN Date', T3.DocTotal as 'Credit Total', T0.DocNum as 'Invoice#', T0.DocDate as 'Invoice Date', T0.DocTotal as 'Invoice Total', T0.CARDCODE as 'BP Code', T0.CardName as 'BP Name', T0.NUMATCARD as 'BP Ref' FROM [dbo].[OPCH] T0 INNER JOIN [dbo].[PCH1] T1 ON T1.DocEntry = T0.DocEntry INNER JOIN [dbo].[RPC1] T2 ON T2.BaseEntry = T1.DocEntry INNER JOIN [dbo].[ORPC] T3 ON T3.DocEntry = T2.DocEntry WHERE T0.DOCDATE >= '[%0]'