Counting Number of Occurrences in a Duplicate Query

  • Thread starter Thread starter BLG
  • Start date Start date
B

BLG

I have created a duplicate query that displays all of the
title names that appear more than once in a table. In
other words if there are 3 occurrences of a title
named "Title 1" appearing in a table, 4 occuurrences of
Title 2, and 2 occurrrences of Title 3, the query displays
the results as follows:

Title Name
Title 1
Title 1
Title 1
Title 2
Title 2
Title 2
Title 2
Title 3
Title 3

I want the query to display the duplicate title names
once, with the number of occurrences in the second column.
So in the example above, the query would display as
follows:

Title Name
Title 1
Title 2
Title 3
 
Try the SQL String something like: (untested)

SELECT [Title Name], Count([Title Name])
FROM [Your Table]
GROUP BY [Title Name]
HAVING Count([Title Name]) >= 2

Check Access Help (JET Reference section on GROUP BY and HAVING Clause)
 
Back
Top