Count Unique Records, only

froggiebeckie

Registered User.
Local time
Today, 06:53
Joined
Oct 11, 2002
Messages
104
In a report, I have a textbox to show the number of employees in the report.
I use this formula :
=Count([last name])
Sometimes the same person has multiple entries, so the count is wrong.
How can I show only the number of different employees and ignore the duplicate names?


Thanks
 
Create a simple Query that will have the Count of Last name based on the table, like..
Code:
SELECT Count(lastName) As CountOfLastName
FROM theTableName
GROUP BY lastName;
Save the Query by giving it a name, then use the Query value in the Report..
Code:
= DCount("CountOfLastName", "theNameOfTheQuery")

EDIT: Edited Code.
 
Last edited:
Cool Beans!!
Thanks so much.
 
Please look at the UPDATE Code.. You need DCount, not DLookUp. Just tested it..
 

Users who are viewing this thread

Back
Top Bottom