4 Replies Latest reply on Nov 15, 2017 11:52 AM by Bommi

    Need help of how to get cost of the vendors




      I have a SQL Query framed like as below to ge the list of vendors who hit the account of 111,111 and 1111 respectively


      I need the details of the costs.How to derive it?



          distinct  asup.vendor_name


           --TO_CHAR(apv.invoice_date,'YYYY') AS Year,

             --TO_CHAR(apv.invoice_date,'Q') AS Qtr,

           -- apv.invoice_date "Invoice Date",

             --apv.INVOICE_AMOUNT "Invoice Amt",

            -- apv.INVOICE_NUM Invoice#


              apps.ap_invoices_all apv,

              apps.ap_suppliers asup,

              apps.ap_invoice_distributions_all adist,

              apps.gl_code_combinations_kfv gl


         --     asup.vendor_id 

           --   in(1220)

         --  TO_CHAR(apv.invoice_date,'YYYY')='2016'

           apv.invoice_date BETWEEN '01-NOV-2016' AND TRUNC(SYSDATE)

          and apv.vendor_id=asup.vendor_id

          and adist.invoice_id=apv.invoice_id

          and gl.code_combination_id=adist.dist_code_combination_id

          and (gl.segment1=111 and gl.segment2=111 and gl.segment3=1111)

          --order by apv.invoice_date