Thursday, January 30, 2014

GL to AP DRILL DOWN SQL -- 11i

select gjb.NAME,gjh.JE_CATEGORY,gjh.JE_SOURCE, (gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4) GL_COMBINATION, --gjl.ACCOUNTED_DR,gjl.ACCOUNTED_CR, ael.ACCOUNTED_DR,ael.ACCOUNTED_CR,ael.REFERENCE5 INVOICE_NUM,pv.VENDOR_NAME from gl_je_batches gjb, gl_je_headers gjh, gl_je_lines gjl, gl_code_combinations gcc, ap_ae_lines_all ael, po_vendors pv where gjb.JE_BATCH_ID=gjh.JE_BATCH_ID and gjh.JE_HEADER_ID=gjl.JE_HEADER_ID and gjl.CODE_COMBINATION_ID=gcc.CODE_COMBINATION_ID and gjl.GL_SL_LINK_ID=ael.GL_SL_LINK_ID and ael.THIRD_PARTY_ID=pv.VENDOR_ID and gjb.JE_BATCH_ID=1549875--1549785 and gcc.segment4='2495'