/* Formatted on 03-08-2011 14:14:08 (QP5 v5.115.810.9015) */
SELECT rsh.SHIPMENT_NUM H_REFERENCE,
pov.VENDOR_NAME H_VENDOR_NAME,
RT.TRANSACTION_TYPE H_AUTO_TRX_CODE,
rsh.RECEIPT_SOURCE_CODE H_RECEIPT_SOURCE,
(SELECT ORGANIZATION_NAME
FROM org_organization_Definitions
WHERE organization_id = rsl.TO_ORGANIZATION_ID
AND set_of_books_id = 5)
H_SHIP_TO_ORGANIZATION,
rsh.EXPECTED_RECEIPT_DATE H_EXPECTED_RECEIPT_DATE,
rsh.WAYBILL_AIRBILL_NUM H_WAYBILL_AIRBILL,
rsh.BILL_OF_LADING H_BILL_OF_LADING
FROM rcv_transactions rt,
po_vendors pov,
rcv_shipment_lines rsl,
rcv_shipment_headers rsh,
po_headers_all poh
WHERE rt.organization_id IN (SELECT organization_id
FROM org_organization_Definitions
WHERE set_of_books_id = 5)
AND TRUNC (rt.Creation_Date) BETWEEN '01-APR-2011' AND '31-JUL-2011'
AND rt.vendor_id = pov.vendor_id
AND rt.shipment_line_id = rsl.shipment_line_id
AND rsl.shipment_header_id = rsh.shipment_header_id
AND poh.po_header_id = rsl.po_header_id
AND poh.po_header_id = rt.po_header_id
ORDER BY TO_NUMBER (poh.segment1)
SELECT rsh.SHIPMENT_NUM H_REFERENCE,
pov.VENDOR_NAME H_VENDOR_NAME,
RT.TRANSACTION_TYPE H_AUTO_TRX_CODE,
rsh.RECEIPT_SOURCE_CODE H_RECEIPT_SOURCE,
(SELECT ORGANIZATION_NAME
FROM org_organization_Definitions
WHERE organization_id = rsl.TO_ORGANIZATION_ID
AND set_of_books_id = 5)
H_SHIP_TO_ORGANIZATION,
rsh.EXPECTED_RECEIPT_DATE H_EXPECTED_RECEIPT_DATE,
rsh.WAYBILL_AIRBILL_NUM H_WAYBILL_AIRBILL,
rsh.BILL_OF_LADING H_BILL_OF_LADING
FROM rcv_transactions rt,
po_vendors pov,
rcv_shipment_lines rsl,
rcv_shipment_headers rsh,
po_headers_all poh
WHERE rt.organization_id IN (SELECT organization_id
FROM org_organization_Definitions
WHERE set_of_books_id = 5)
AND TRUNC (rt.Creation_Date) BETWEEN '01-APR-2011' AND '31-JUL-2011'
AND rt.vendor_id = pov.vendor_id
AND rt.shipment_line_id = rsl.shipment_line_id
AND rsl.shipment_header_id = rsh.shipment_header_id
AND poh.po_header_id = rsl.po_header_id
AND poh.po_header_id = rt.po_header_id
ORDER BY TO_NUMBER (poh.segment1)
No comments:
Post a Comment