1 Reply Latest reply on Oct 6, 2017 5:06 PM by DaveB111

    Need SQL Query for charged invoices to our account 2222

    1567114

      Hello,

       

      Please can anybody help to provide a SQL to fetch charged invoices to our account 2222

        • 1. Re: Need SQL Query for charged invoices to our account 2222
          DaveB111

          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

                   where 1=1

                    and b.segment4 = 140311

                    and a.period_name  = 201701;

          1 person found this helpful