find duplicates query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trueadvantage
    New Member
    • Feb 2008
    • 12

    find duplicates query

    CAN U HELP ME?

    Hi... I have 1 little but critical (for me) problem regarding access query.

    Problem Details: -

    I have one table which includes Employee Name and Employee ID

    Table:-

    EmpName EmpID
    A 11
    B 12
    C 11
    D 13
    E 12
    F 14
    G 14
    H 15
    I 16

    If you look at above table, u will come to know that some employee has got same emp numbers.

    I want to build a query which will help me to find out those emp names who got same empid.

    if anybody understand my problem so please send me query.

    Thnnx in advance
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    I have split this post out into its own thead as it was hijacking the thread it was on.

    Have you tried creating a Find Duplicates query?

    If you try to find duplicate empID and include the empname field. It should give you the results you want.

    Comment

    • aas4mis
      New Member
      • Jan 2008
      • 97

      #3
      Originally posted by trueadvantage
      CAN U HELP ME?

      Hi... I have 1 little but critical (for me) problem regarding access query.

      Problem Details: -

      I have one table which includes Employee Name and Employee ID

      Table:-

      EmpName EmpID
      A 11
      B 12
      C 11
      D 13
      E 12
      F 14
      G 14
      H 15
      I 16

      If you look at above table, u will come to know that some employee has got same emp numbers.

      I want to build a query which will help me to find out those emp names who got same empid.

      if anybody understand my problem so please send me query.

      Thnnx in advance
      Try this:

      Code:
      SELECT EmpName, count(EmpID)
      FROM tblMyTable
      GROUP BY EmpName
      HAVING count(EmpID) > 1;
      I'm still new to access myself but I believe this is what you're looking for.

      Comment

      Working...