I need to use minus in the formulae for a running total..The query that requires this in sql/toad is
select shipnode_key, count(1) backorderedcnt from
(select isn.shipnode_key, ol.order_line_key from
yfs_order_line ol,
yfs_order_header oh,
yfs_item_ship_node isn,
yfs_order_release_status ors
where ol.req_ship_date = to_date(to_char(sysdate)) and
oh.order_header_key = ol.order_header_key and
oh.document_type = '0001' and
oh.hold_flag = 'N' and
isn.item_id = ol.item_id and
isn.shipnode_key in ('8', '31', '51', '52') and
ors.order_header_key = ol.order_header_key and
ors.order_line_key = ol.order_line_key and
ors.status = '1400'
minus
select isn.shipnode_key, ol.order_line_key from
yfs_order_line ol,
yfs_item_ship_node isn,
yfs_order_release_status ors
where ol.req_ship_date = to_date(to_char(sysdate)) and
isn.item_id = ol.item_id and
isn.shipnode_key in ('8', '31', '51', '52') and
ors.order_header_key = ol.order_header_key and
ors.order_line_key = ol.order_line_key and
(ors.status = '3200' or
ors.status = '3300' or
ors.status = '3700' or
ors.status = '9000') ) ord
group by ord.shipnode_key, ord.order_line_key
I am selecting data in crystal with just the
isn.shipnode_key in ('8', '31', '51', '52') and oh.document_type = '0001' filters,
Since there are many queries like the above with different filter for statuses I am using the general filter mentioned above to get the data then doing a running total to get the count with some more of the filter in the evaluate option of Running total command. How can i provide this minus in the filter so as to get the count.
Please help
select shipnode_key, count(1) backorderedcnt from
(select isn.shipnode_key, ol.order_line_key from
yfs_order_line ol,
yfs_order_header oh,
yfs_item_ship_node isn,
yfs_order_release_status ors
where ol.req_ship_date = to_date(to_char(sysdate)) and
oh.order_header_key = ol.order_header_key and
oh.document_type = '0001' and
oh.hold_flag = 'N' and
isn.item_id = ol.item_id and
isn.shipnode_key in ('8', '31', '51', '52') and
ors.order_header_key = ol.order_header_key and
ors.order_line_key = ol.order_line_key and
ors.status = '1400'
minus
select isn.shipnode_key, ol.order_line_key from
yfs_order_line ol,
yfs_item_ship_node isn,
yfs_order_release_status ors
where ol.req_ship_date = to_date(to_char(sysdate)) and
isn.item_id = ol.item_id and
isn.shipnode_key in ('8', '31', '51', '52') and
ors.order_header_key = ol.order_header_key and
ors.order_line_key = ol.order_line_key and
(ors.status = '3200' or
ors.status = '3300' or
ors.status = '3700' or
ors.status = '9000') ) ord
group by ord.shipnode_key, ord.order_line_key
I am selecting data in crystal with just the
isn.shipnode_key in ('8', '31', '51', '52') and oh.document_type = '0001' filters,
Since there are many queries like the above with different filter for statuses I am using the general filter mentioned above to get the data then doing a running total to get the count with some more of the filter in the evaluate option of Running total command. How can i provide this minus in the filter so as to get the count.
Please help