Query Problem

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

    Query Problem

    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
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    Originally posted by trueadvantage
    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

    Thnnx in advance
    A "Find Duplicates" query like this might help.
    [Code=sql]
    SELECT YourTable.EmpID , YourTable.[Employee Name]
    FROM YourTable
    WHERE (((YourTable.Em pID) In (SELECT [EmpID] FROM [YourTable] As Tmp GROUP BY [EmpID] HAVING Count(*)>1 )))
    ORDER BY YourTable.EmpID ;
    [/CODE]

    JS

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32662

      #3
      I'm sure you must be confused by the answers you're receiving, but please don't simply post the question again. Ask for clarification.

      Most of our experts understand that not everyone can be Access or SQL experts. Just let us know what you don't understand and we can clarify further.

      The Simple SQL Problem thread has pretty well the same question and a very similar answer in it.

      Do you understand the answer now?
      If not, what do you still need to know?

      Comment

      • trueadvantage
        New Member
        • Feb 2008
        • 12

        #4
        Originally posted by NeoPa
        I'm sure you must be confused by the answers you're receiving, but please don't simply post the question again. Ask for clarification.

        Most of our experts understand that not everyone can be Access or SQL experts. Just let us know what you don't understand and we can clarify further.

        The Simple SQL Problem thread has pretty well the same question and a very similar answer in it.

        Do you understand the answer now?
        If not, what do you still need to know?

        Hi,

        I have run the query as per your and others suggesion. But still im not able to run this query. it shown same error. thats y i putted same threads with all details.

        Thanks,

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          OK.
          But that won't help you much. All you'll get is irritated responses from the people trying to help you.

          What I'd like to see in here now is the actual SQL code you're using, and a brief explanation of what's actually happening.
          Does it run but give incorrect results for instance?
          Does it throw up an Access Error Message of some sort (if so provide this of course)?

          I suspect we can help you, but you need to co-operate with us ok.

          Comment

          Working...