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,

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