Results 1 to 2 of 2
  1. #1
    Johin.b is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7

    Merging & removing duplicates

    Hi Guys,



    I have a table with few Employee ID re-appearing over and over again for two different job status.

    Data Example

    EMP ID Job Code Emp Name Country Job Status Time Spent (In Hrs)
    222 9250 XYZ ABC Complete 6
    222 1059 XYZ ABC InComplete 12
    222 5050 XYZ ABC Complete 7
    222 1050 XYZ ABC InComplete 9
    111 2750 MNM IJK Complete 2
    111 2150 MNM IJK InComplete 3
    111 6550 MNM IJK Complete 7
    111 8250 MNM IJK InComplete 9

    I need an output which merges the data based on Emp ID, however, adds the time spent for completed and incompleted job status in 2 rows.

    Output Requirement:

    EMP ID Emp Name Country Job Status Time Spent (In Hrs)
    222 XYZ ABC Complete 13
    222 XYZ ABC InComplete 21
    111 MNM IJK Complete 9
    111 MNM IJK InComplete 12

    Which query to use? I use Access 2010. Step by step info would greatly help.

    Regards,
    Joe

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try an aggregate GROUP BY (Totals) query

    SELECT [Emp ID], [Emp Name], Country, [Job Status], Sum([Time Spent (In Hrs)] AS TotHrs FROM tablename GROUP BY [Emp ID], [Emp Name], Country, [Job Status];

    Access Help has guidelines on using the query builder to create aggregate query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 03-29-2013, 11:05 AM
  2. Removing duplicates
    By DAVID W in forum Access
    Replies: 5
    Last Post: 12-21-2011, 03:15 PM
  3. Removing duplicates & printing uniques
    By sp3cialed in forum Access
    Replies: 1
    Last Post: 08-06-2011, 12:31 AM
  4. Need help removing duplicates
    By warlock in forum Queries
    Replies: 1
    Last Post: 04-14-2011, 03:44 PM
  5. Merging
    By bailey537 in forum Queries
    Replies: 0
    Last Post: 07-14-2009, 04:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums