How do I count number of UNIQUE entries?

  • Thread starter Thread starter andrew
  • Start date Start date
A

andrew

Basically, there is a column that has a USERID....and I want (In
Access, either in a report or query) to list the number of unique
USERID's that appear in the last 24 hours.


What function do I use to count the number of Unique entries in a
specific column etc....does this exist?
 
Create a query that retrieves the unique IDs from the table:

SELECT DISTINCT UserID FROM MyTable WHERE InputDate > Date() -1

Run a query on that query:

SELECT Count(*) FROM MyQuery

In Access 2000 and newer, you can do this all in one query:

SELECT Count(*)
FROM
(
SELECT DISTINCT UserID FROM MyTable WHERE InputDate > Date() -1
)
 
Back
Top