Report Record Counting Question

  • Thread starter Thread starter Shadow
  • Start date Start date
S

Shadow

I use the following statement in the Report Footer to
count & display the number of records in a category
{RemoveBitterbrush}:

=DCount
("[RemoveBitterbrush]","tblPermitData","[RemoveBitterbrush]
= Yes ")

This is a yes/no category but you could substitue "A" etc.
(assuming they are text) for your 5 values.

Try HELP and search for DCount
 
While this might work if the report isn't filtered or if you don't need a
total count that matches the report's record source, it isn't the most
efficient. If you want to count the number of records in a report where an
expression is true (RemoveBitterbrush=True) then use:
=Abs( Sum(RemoveBitterbrush=True) )
This will accurately count the matching records in a report even if the
report is filter to a subset of data.

--
Duane Hookom
MS Access MVP


Shadow said:
I use the following statement in the Report Footer to
count & display the number of records in a category
{RemoveBitterbrush}:

=DCount
("[RemoveBitterbrush]","tblPermitData","[RemoveBitterbrush]
= Yes ")

This is a yes/no category but you could substitue "A" etc.
(assuming they are text) for your 5 values.

Try HELP and search for DCount

-----Original Message-----
I have a query based report that returns a recordset with a field that
has 5 possible values; for example A,B,C,D,E.

I want to count the number of records for each value in that field.

For example if there are a total of 100 records returned by the query
with:

50 records = A
10 records = B
10 records = C
10 records = D
20 records = E

I want to be able to show these counts on the report.

Is this possible, and if so how?
.
 
Back
Top