DCount to find unique values?

gojets1721

Registered User.
Local time
Today, 15:01
Joined
Jun 11, 2019
Messages
430
Hi so I've got a database of complaints that employees have submitted. One of the fields is the "Employee" field and this lists the name of the employee who submitted the complaint.

In a report, I'm trying to find a way for it to display the total number of unique employees that have a submitted a complaint. Is there a way to use dcount or some other function to do that?

Thx
 
Last edited:
You can make a Group By query of the complaints and return just the Employee field and the count of complainID or some other field.

Then that query would return
John Smith 10
Mike Brown 25

 
Hi. You can also take a look at this.

 
In a report, I'm trying to find a way for it to display the total number of unique employees that have a submitted a complaint. Is there a way to use dcount or some other function to do that?
another alternative to MAJp's suggestion that might be easier to follow is to use the distinct keyword on the employee field and put dcount() of the field in the 2nd field of the query. then just report on one of those records. or, create a report by hand and use dcount() in a stand-alone manner inside a control of your choice. that should work too.
 
Using Distinct for this purpose could result in missing items. Use a totals query with group by "Employee" and Count(*) to count complaints.
 

Users who are viewing this thread

Back
Top Bottom