Monday, 31 October 2011

po_tax_with_item_name _quryin11i

SELECT   DISTINCT poh.segment1 po_number,
                  mis.segment1 item_name,
                  TRUNC (poh.CREATION_DATE) po_date,
                  potax.TAX_TYPE,
                  jit.TAX_NAME,
                  potax.PRECEDENCE_1,
                  potax.PRECEDENCE_2,
                  potax.PRECEDENCE_3,
                  potax.PRECEDENCE_4,
                  potax.PRECEDENCE_5
  FROM   po_headers_all poh,
         po_lines_all pol,
         mtl_system_items_b mis,
         JA_IN_PO_LINE_LOCATION_TAXES potax,
         JA_IN_TAX_CODES jit
 WHERE       poh.PO_HEADER_ID = pol.PO_HEADER_ID
         AND mis.inventory_item_id = pol.ITEM_ID
         AND potax.PO_HEADER_ID = poh.PO_HEADER_ID
         AND potax.TAX_ID = jit.TAX_ID
         -- AND pol.po_line_id = potax.po_line_id
         AND TRUNC (poh.creation_date) BETWEEN '01-jan-2011'
                                           AND  '01-apr-2011'

No comments:

Post a Comment