How to Find Distinct Records by Using DCount? (1 Viewer)

JithuAccess

Member
Local time
Yesterday, 18:49
Joined
Mar 3, 2020
Messages
297
Hello Guys,

How can I use Distinct Function with DCount?

This is my Code

Code:
=DCount("[strEmp ID]","[tblMonthly Report Raw Data]","[datPayment Date] Between #2020-04-01# and #2020-04-30#")

I want to find the Unique Employee ID. there are Total 10 Employee IDs and 2 of them are Repeated and in my Report I want to show Just 8 Not 10.

Could you please let me know how to Fix this?

Thanks
 

Isaac

Lifelong Learner
Local time
Yesterday, 17:49
Joined
Mar 14, 2017
Messages
8,738
I think you'd have to write something for that, dcount cannot
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:49
Joined
Oct 29, 2018
Messages
21,358
You could create a DISTINCT query and DCount() that.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:49
Joined
Oct 29, 2018
Messages
21,358
Can we give something like [StrEmp ID]=Unique in the Criteria?

Thanks
No, not with the built-in DCount(). You could, as @Isaac said, create your own function that will allow you to do that.

Or, you could use this one:
 

JithuAccess

Member
Local time
Yesterday, 18:49
Joined
Mar 3, 2020
Messages
297
No, not with the built-in DCount(). You could, as @Isaac said, create your own function that will allow you to do that.

Or, you could use this one:
Thank You. I will go with Query
 

Users who are viewing this thread

Top Bottom