Here is the Query that I pulled.
select
dis.VENDORID,
inv.TRXDSCRN,
inv.DOCDATE,
inv.PONUMBER,
inv.DOCNUMBR,
gl.ACTNUMST,
inv.DOCAMNT,
dis.DEBITAMT,
dis.CRDTAMNT,
dis.DISTTYPE
from PM20000 as inv
Left OUTER JOIN PM10100 as dis ON inv.VENDORID = dis.VENDORID
Left OUTER JOIN gl00105 as gl ON gl.ACTINDX = dis.DSTINDX
WHERE dis.DISTTYPE = '6'
order by inv.VENDORID, DOCNUMBR
I am sure it has to do with my joins, but I have tried every scenario i can think of. My goal is to export all OPEN AP invoices along with the GL distributions (expense only), so that I can import into a new company via IM.
However, my output shows the correct document numbers, amounts, and GL but when it comes to the DEBITAMT Column, it seems to duplicate to how many invoices are open for the vendor.
Example: Doc ending in 201 should be $1720 but rows 2 and 3 show a debit amount of both open transactions.
Thank you in advance for your assistance.
*This post is locked for comments