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

Count records based on the result of a running total? 1

Status
Not open for further replies.

crumpm

Technical User
Mar 29, 2010
31
GB
CR 2008 on an SQL database.

I need to count the records for each of my names, but the suppression field uses a running total, and I can't work out how to distinctcount.


Gp1: Name
Gp2: Reference
Gp3: Details: Units of Time: Value of Time: Activity Code: Budget Vale:


I have running totals in the Reference group footer, for the time value by each different activity code.

I have a separate formula that evaluates each of the activity totals against the budget value for that specific activity, which generates a %.

I then suppress each reference group if none of the % > 80.

I can't work out how to count how many records are displayed for each name.


I hope someone can make sense of my problem !

Thanks




 
You will need to use variables.

In Name Grp Header
@resetRef
whileprintingrecords;

Global numbervar ref:=0// this will be your ref erence count for each name.

In Reference Group Header
@ResetAct
whileprintingrecords;

Global booleanvar act := false;

In Activity Grp3 footer where you calculate %age
@Act%
whileprintingrecords;

Global booleanvar act;

If --your %age formula > 80 then act:= true

In ref grp2 Footer
@Ref
whileprintingrecords;

Global numbervar ref;
Global booleanvar act;

If act = true then ref:= ref+1

In Name Grp1 Footer

@DisplayRef
whileprintingrecords;

Global numbervar ref;

With the exception of name Grp1 Footer other sections can be suppressed, or if they can not be suppressed then the variable formula can be suppressed.
Variables to display data can only be used in footers after the data has been processed
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top