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

    Show fields from multiple records in query

    I have a database with 2 tables. One table contains a list of team leaders. The second table contains a list of workers. The workers table is as follows:



    Table: Workers
    Id Name Surname Group
    1 John Joseph A
    2 Joe Johnson B
    3 Arthur Edgar B

    Table: TeamLeaders
    Id Name Surname Group
    1 Edward Fox A
    2 John Grant B
    3 Ethan Carter A

    The team leader is similar and the two tables are linked by the Group. Some groups have more than 1 team leader.

    I want to run a query which will give me the worker along with all the team leaders as below:

    John Joseph A Edward Fox Ethan Carter
    Joe Johnson B John Grant

    Would it make it easier if I broke my Workers into Groups?

    Thank you,

    Irvy

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Do you have to see each worker and all related team leaders on the same row?
    In my experience, that is not easy to do, because in the scenario you've given above, Access will want to show your data like this:
    John Joseph A Edward Fox
    John Joseph A Ethan Carter
    . . .
    What you want CAN be done . . . but it involves jumping through some hoops [relatively speaking].
    Much easier to go with how Access [and other databases] works by default.

  3. #3
    irvy is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    2

    Thank you

    Hi Robeen,

    Thank you for your reply. I thought that might be the case. I can work with the double records, but just thought it might look more efficient the other way, if it was easy enough to do.

    Irvy

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Perhaps someone else will look in here and tell us if there is an easy way to get this done.
    Every time I've done it, I've used a Function that Loops through the records and writes stuff out the way you want to a separate table.
    If you want to go that route, I can point you in the direction and/or give you some sample code for a function.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-12-2011, 05:19 PM
  2. Show data not in table A using multiple fields
    By mikesmith01 in forum Access
    Replies: 3
    Last Post: 02-25-2011, 08:38 AM
  3. Replies: 2
    Last Post: 11-05-2010, 04:47 AM
  4. multiple fields in separate records
    By Fredo0709 in forum Database Design
    Replies: 9
    Last Post: 04-09-2010, 12:23 PM
  5. Replies: 1
    Last Post: 12-10-2009, 08:41 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