COUNTDISTINCT function counts the number of distinct non-blank values in a subform's field or in two or more fields.
COUNT(VALUE1, VALUE2, VALUE3, ...)
When used with subforms, the argument to
COUNTDISTINCT() must include a reference to the form's subform field and then the field within the subform, using the dot notation.
COUNTDISTINCT function accepts arguments of any type.
If you have a Projects form, with a subform containing the cities where the project is being implemented, you might want to know the distinct number of countries where the project is being implemented.
If you have a project that has the following subrecords:
Then the result of
COUNTDISTINCT(CITIES.COUNTRY) would be 2, though
COUNT(CITIES.COUNTRY) would be 3.