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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using running totals as selection criteria

Status
Not open for further replies.

bombplayer

Programmer
Jul 3, 2001
47
US
I have a database that is composed of customer payment data. This data is grouped by state then by customer similar to as follows:

Alabama
Customer 1 - 1/1/02 Payment Due
Customer 1 - 2/1/02 Payment Due
Customer 2 - 2/1/02 Payment Due
Alaska
Customer 1 - 1/1/02 Payment Due
Customer 2 - 2/1/02 Payment Due

I want to only report the data from a user defined interface. If a user inputs 2 or more, then only customer 1 from Alabama is reported. I have tried to use running totals but r.t.'s can't be used as selection criteria. I tried to use a counter but can not come up with the correct formula to use. The formula I was using was similar to:

Global Numbervar PastDuePayments;

If Pastdue=Yes then PastDuePayments:= Pastduepayments+1 else pastduepayments

This resulted in a running total but would zero out at the end of the group. Any help would be appreciated.
 
bombplayer,

Try changing your grouping to include a Customer_number group at the lowest level. Place the database fields in the group footer. Suppress group header for the Customer number group.

In the section expert - highlight the customer number group footer - and click the (x+2) button next to suppress.

Write this formula: Count({db.customer_name},{db.customernumber})< {?input parameter}

This will suppress any group with less than the user input -thus showing what you want to see.

Hope this helps,

paulmarr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top