Search 800 + Posts

Jan 15, 2011

Query to get the lines where cancel as well as open Flag = Y

Query to get the lines where Cancel flag = Y,Cancel Qty <> 0  but Open Flag = Y too

SELECT oh.header_id,
oh.order_number,oh.cancelled_flag,oh.open_flag,oh.booked_flag,
oh.FLOW_STATUS_CODE,ol.LINE_ID,ol.CANCELLED_FLAG,ol.OPEN_FLAG, ol.BOOKED_FLAG

FROM oe_order_headers_all oh, oe_order_lines_all ol
WHERE oh.header_id=ol.header_id
and ol.open_flag ='Y' and oh.open_flag ='Y'
and oh.flow_status_code='BOOKED'
and NVL(ol.cancelled_quantity,0) > 0
and NVL(ol.cancelled_flag,'N') ='Y'
and NVL(ol.ordered_quantity,0) = 0
AND ol.flow_status_code ='CANCELLED

No comments:

Post a Comment