Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using running total evaluate formula to filter data from tables

Status
Not open for further replies.

111222888

Programmer
May 11, 2004
1
US
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
 
Please post basic technical information when posting, such as:

Not knowing the environment will likely net numerous posts and bad guesses.

I would suggest creating a parameterized stored procedure and using that as the data source for the Crystal Report.

Pass the following link along to your dba, or if you're a reasonable SP coder:


-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top