Results 1 to 3 of 3
  1. #1
    rev is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    2

    Combining rows in query?

    Let me start by apologizing if this is dumb, I'm pretty new to Access and totally self taught. I've been searching for an answer for days (google) and I'm just not getting anywhere.



    I have training data that shows a unique employee ID and a training date for each of the 4 courses they have either taken, or still need to take. I am retrieving the employee ID from the Training_Headcount table and the completion dates from the Training_Data table. Here is my query:

    SELECT Training_Headcount.ID, IIf([Course Type Number]=50696650,[completion date]) AS 50696650, IIf([Course Type Number]=60124831,[completion date]) AS 60124831, IIf([Course Type Number]=50461876,[completion date]) AS 50461876, IIf([Course Type Number]=60242846,[completion date]) AS 60242846, IIf([Course Type Number]=51367268,[completion date]) AS 51367268
    FROM Training_Data INNER JOIN Training_Headcount ON Training_Data.[Learner ID] = Training_Headcount.ID
    ORDER BY Training_Headcount.ID;

    Here's the problem, when I run the query I get a new row for each time an ID shows a completion date. (See attachment "what I got")

    I would like to have a single row for each ID with an entry for their training dates going across. (See attachment "what I want")

    Can anyone help me figure out how to accomplish this?
    Attached Thumbnails Attached Thumbnails What I got.JPG   What I want.JPG  

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    This method may work for you. Look at it and try it.

    http://www.datapigtechnologies.com/f.../crosstab.html

  3. #3
    rev is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    2
    Thanks Alan. That's the same process I'm following but the issue (I believe) is that my ID column returns results that are not unique. In the example on datapigtechnologies.com the values for segment (which would be ID for me) are unique and therefore are not returning multiple times down for each cross tab entry across the top.

    I need to figure out if I can combine the appearance of identical ID's into a single row? Any ideas?

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

Similar Threads

  1. Replies: 5
    Last Post: 03-29-2012, 09:21 PM
  2. Replies: 0
    Last Post: 02-09-2012, 05:43 PM
  3. Combining rows
    By Bing in forum Queries
    Replies: 1
    Last Post: 06-09-2011, 12:54 PM
  4. Combining value in multiple rows into new field
    By stricklanpbs in forum Access
    Replies: 4
    Last Post: 05-05-2011, 11:29 AM
  5. Combining columns into rows
    By steeveepee33 in forum Queries
    Replies: 5
    Last Post: 04-30-2009, 09:18 PM

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