Counting the number of records in a report and returning a percent

G

Guest

Is there a way in Access to count the number of records returned in a group
on a report then turn that number into a percentage of the total number of
records?
 
D

Duane Hookom

You can add a text box to your report header:
Name: txtCountAll
Control Source: =Count(*)

Add a control to your group header or footer
Control Source: =Count(*)/txtCountAll
 
G

Guest

I have one step further that I have a question on. I have a field called CPT
and it contains 112 records. There are duplicates in this field which is
fine, but I want to count the number of unique records which I know is 80.
How can that be done? I just want the "80" displayed on the report.

Thanks.
 
D

Duane Hookom

Create a query that groups by CPT. Then add a text box to your report:
=DCount("*","qgrpCPT")
where qgrpCPT is your group by query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top