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 All Records And Filtered Records

Status
Not open for further replies.

dwearden

MIS
Apr 19, 2002
8
0
0
GB
I have a database with two specific fields, datereceived and type (T)or (P). I want to count all records received between two dates, which are set as parameters, but only show records of type T in the report.
I have tried using a formula to count the number of records between the two dates using 'WhileReadingRecords' but it counts all the records in the file it seems to ignore the specific dates.
Where should the formula field go in the report, I assumed it was in report header.
Any help please ?
 
If you want to report on all records, but only want to display Ts, place your records in the detail section. Conditionally suppress the section with &quot;Type <> 'T'&quot;. Use a running total to count the records. This will count records which have also been suppressed, giving you a true total record count.

Naith
 
to add to what Naith said...this will get you the total records that were collected

In order to just get the &quot;T&quot; records...I think that a summary count will do that for you

Group your report on {Table.Type} sort ascending so the Type &quot;T&quot; comes last.

the running count will work as described in the post by Naith.

In the footer place the running count formula + a summary count formula of the count

Since you will have conditional suppress on the Group header, detail and Group footer sections then the running total displayed will be for all records....and the summary count of {Table.Type} will be the count of just that group.

Jim Broadbent
 
Naith explained the count/display portion, add to that limiting the rows being returned to the report using the record selection criteria (use Database->Edit Selection Formula->Record) to only have the dates you want (increasing performance).

Depending upon how how you're using parameters, you would use something like this:

If you have 2 Parameters called {Date Range Start} and {Date Range End}:

(
({MyTable.MyDate} >= {?Date Range Start})
and
({MyTable.MyDate} <= {?Date Range End})
)

If you have one Range Parameter called {Date Range}

({MyTable.MyDate} in {?Date Range})

-k kai@informeddatadecisions.com
 
Thanks a lot guys your input has solved my problems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top