SQL query to get multiperiod accounting in Accounts Payable
Summary:
Hi Gurus,
I am struggling to get the correct data for multiperiod accounts details to match the GL account (Deferred). Build a query from AP to SLA but getting duplicate rows/data, if the invoices lines or distribution has more than one ITEM lines (if Invoice has 3 lines then duplicate 3 times). Splitted into two chunks (AP) and SLA and getting correct data, once linked to SLA getting duplicate values based on no of invoice lines.
SELECT distinct XAH.AE_HEADER_ID "Invoice Id",
aia.INVOICE_id,
aia.INVOICE_NUM "Invoice Number",
aia.INVOICE_DATE "Invoice Date",
aia.INVOICE_AMOUNT "Amount",
0