Solved

Add ID number to potential duplicate query

Posted on 2014-04-01
1
262 Views
Last Modified: 2014-04-03
Hello Experts.

I am working on a query that I just can't get to work the way I need.  I have written the following query that identifies subject names (subjectName) that exist more than once in the table:

SELECT multipleSubjectNameQry.subjectName
FROM multipleSubjectNameQry
GROUP BY multipleSubjectNameQry.subjectName
HAVING ((Count(*))>1);

Open in new window


But I need this query to also display the record number (primary key).  But, when I add the primary key field the query doesn't return anything because the results are no longer duplicates.  How can I modify this query so that it provides the list of subject names that exist more than once, along with their record numbers?

Any help would be greatly appreciated.  I am working with MS Access 2013 on Windows 7.

Also, I have tried the following, but it doesn't work either:

SELECT multipleSubjectNameQry.subjectName, multipleSubjectNameQry.myID
FROM multipleSubjectNameQry
GROUP BY multipleSubjectNameQry.subjectName, multipleSubjectNameQry.myID
HAVING (((Count(multipleSubjectNameQry.subjectName))>1));

Open in new window



Thanks,
J
0
Comment
Question by:ferguson_jerald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39970393
Use the Find Duplicates wizard to create the query.  You can have it return whatever you want.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question