J.Rommers
J.Rommers

Reputation: 69

Counting in an access report

I'm creating a database for different job courses with multiple reports, in these reports I want to show the precentage of people that completed the course. To achieve this I need data from two different queries. One query contains the names of all the employees. And the second query contains the names of the people that completed a certain course. What would be the best aproach to achieve what I need?

I know there is a Count() function in access. But I dont know how to get data from two different queries. For easy reference lets say i use the flowing names. qryAllEmployees contains the fiels personal number and name. QryCourseCompleted contains the name and data of completion. The report is named rptCompleted, this report contains a field where I want to show the precentage of employees that completed the course.

I hope someone can help me. If additional information is needed please tell me! Thanks in advance for your time and efford!

Joeri

Upvotes: 1

Views: 80

Answers (1)

Andre
Andre

Reputation: 27634

To use such data directly as controlsource e.g. in a report, use Domain Aggregate functions (scroll down a little).

In your case: DCount() .

= DCount("*", "QryCourseCompleted") / DCount("*", "qryAllEmployees")

should work as controlsource of your report textbox (format as percent).

Upvotes: 2

Related Questions