In SQL Server you can count up the distinct values in a column of a query using syntax like:
SELECT SalesPersonID, COUNT(DISTINCT CustomerID) As NumberOfDistinctCustomersServed FROM ClosedSales
GROUP BY SalesPersonID
This will give you the number of unique customers that SalesPersonID has closed.
Access only allows you to use DISTINCT to get unique records over the whole recordset, like:
SELECT DISTINCT SalesPersonID, CustomerID FROM ClosedSales
This would give you a list of unique SalesPersonIDs paired with CustomerIDs, but you can’t count them in this step.
In Access you could use the SELECT DISTINCT query as a subquery and then count the CustomerIDs in this query to get the same results as the SQL Servier query. Here is how that would look:
SELECT SalesPersonID, COUNT(CustomerID) FROM
(SELECT DISTINCT SalesPersonID, CustomerID FROM ClosedSales) AS SubQuery
GROUP BY SalesPersonID
This is a little more ugly and hard to plugin to other queries, but it works.