0
votes

I've been trying to get dcount to work in an existing database with queries and report names that are the same and was giving myself a headache, so I created a simple 1 table db to test it out.

It has a field1 with these values id1 id1 id2 id3

I want to count the number of distinct values. i.e. get 3 from the above. I created a report with a field in the report footer with the expression

=DCount("[Field1]","Table1")

..it returns 4

Yet when I check the microsoft site for the description of how dcount works, it distinctly says it counts distinct entries.
Can someone clarify?

1

1 Answers

1
votes

I don't know which page you are referring to, but DCount simply counts records, not distinct values.

To count distinct values, I suggest Allen Browne's "Extended DCount" aka ECount function: http://allenbrowne.com/ser-66.html

This page has also more information about how DCount works.