How do I count number of UNIQUE entries?

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?
 
D

Douglas J. Steele

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
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top