1 person found this helpful
Our GL natural account is stored in segment4. You'll have to alter the query to use whatever segment your natural account is store in.
SELECT b.segment2 as location, c.INVOICE_NUM, a.amount as DistributionAmount
FROM AP_INVOICE_DISTRIBUTIONS_ALL a
left outer join GL_CODE_COMBINATIONS_V b on a.DIST_CODE_COMBINATION_ID=b.CODE_COMBINATION_ID
left outer join ap_invoices_all c on a.INVOICE_ID = c.INVOICE_ID
and b.segment4 = 140311
and a.period_name = 201701;