You are on page 1of 2

ONLY APPROVED REQUISITIONS QUERY ------------------------------SELECT distinct prh.segment1 "Req #", ppx.full_name "Requestor Name", prh.authorization_status, sum(prl.

quantity) Qty, prh.type_lookup_code, prh.org_id FROM po_requisition_headers_all prh, po_requisition_lines_all prl, po_req_distributions_all prd, per_people_x ppx WHERE prh.requisition_header_id = prl.requisition_header_id AND ppx.person_id = prh.preparer_id AND prd.requisition_line_id = prl.requisition_line_id and prh.org_id = prl.org_id and prh.authorization_status = 'APPROVED' --and prh.org_id = 549 group by prh.segment1, ppx.full_name, prh.authorization_status, prh.type_lookup_code, prh.org_id order by prh.org_id,1

THIS IS FOR ALL ------------------SELECT distinct prh.segment1 "Req #", ppx.full_name "Requestor Name", prh.authorization_status, sum(prl.quantity) Qty, prh.type_lookup_code, prh.org_id FROM po_requisition_headers_all prh, po_requisition_lines_all prl, po_req_distributions_all prd, per_people_x ppx WHERE prh.requisition_header_id = prl.requisition_header_id AND ppx.person_id = prh.preparer_id AND prd.requisition_line_id = prl.requisition_line_id and prh.org_id = prl.org_id -- and prh.authorization_status = 'APPROVED' --and prh.org_id = 549 group by prh.segment1, ppx.full_name, prh.authorization_status, prh.type_lookup_code, prh.org_id order by prh.org_id,1 -------------------------

REQUISITIONs WITH PO INFORMATION ----------------------------------SELECT distinct prh.segment1 "Req #", -- prh.creation_date, -- prh.created_by, ppx.full_name "Requestor Name", poh.segment1 "PO #", -- prh.description "Req Description", prh.authorization_status, --prh.note_to_authorizer, --prh.type_lookup_code, --prl.line_num, --prl.line_type_id, --prl.item_description, --prl.unit_meas_lookup_code, --prl.unit_price, sum(prl.quantity) Qty, -- sum(prl.quantity_delivered) Qty_Delivered, --prl.need_by_date, --prl.note_to_agent, --prl.currency_code, --prl.rate_type, --prl.rate_date, --prl.quantity_cancelled, --prl.cancel_date, --prl.cancel_reason, prh.type_lookup_code, prh.org_id FROM po_requisition_headers_all prh, po_requisition_lines_all prl, po_req_distributions_all prd, per_people_x ppx, po_headers_all poh, po_distributions_all pda WHERE prh.requisition_header_id = prl.requisition_header_id AND ppx.person_id = prh.preparer_id -- AND prh.type_lookup_code = 'INTERNAL'--'PURCHASE' AND prd.requisition_line_id = prl.requisition_line_id AND pda.req_distribution_id = prd.distribution_id AND pda.po_header_id = poh.po_header_id --AND TO_CHAR (prh.creation_date, 'YYYY') = '2012'-- IN ('2010', '2011') and prh.org_id = poh.org_id --and prh.org_id = 549 group by prh.segment1, poh.segment1, ppx.full_name, prh.authorization_status, prh.type_lookup_code, prh.org_id order by prh.org_id,1

You might also like