Duplicate value query

N

Naz

Hi,

I have a table that has a list of User Names and references next to them, i
have a lot of duplicate records. For each of the users i want to count the
number of unique references.

I can do this using 2 queries, where the first one is a simple query with
the property for Unique Records set to Yes, and then have a second query that
groups the User Names and counts the records.

But is there a way to do this in 1 query?


All help is appreciated.
 
S

S Panja

Check out query wizard.
--
***************************
If the message was helpful to you, click Yes next to Was this post helpful
to you?
If the post answers your question, click Yes next to Did this post answer
the question?
 
J

John Spencer

Yes it can be done. You can't do it in the query grid, but must build the
query in the SQL window

SELECT UserNames, Count(References)
FROM (SELECT Distinct UserNames, References
FROM YourTable) as UniqueNames
GROUP BY UserNames

If you need a more specific example,
Please copy and post the SQL of your existing queries

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message
 
Top