Results 1 to 2 of 2
  1. #1
    LuLeBe is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2019
    Posts
    1

    Group multiple rows into single rows with multiple columns

    Hello,

    I'm currently facing the following problem:
    I have a table "classes" with various columns including "date" and "teacher". I want to create a query that outputs one row for all results of the same date, with columns "teacher1" to "teacher6" that'll be filled or contain empty strings based on how many rows there are for that date (never more than 6).

    So basically turn this:
    date teacher
    05-05-2019 T1
    05-05-2019 T2
    05-05-2019 T3
    04-04-2019 T1

    into this:


    date teacher1 teacher2 teacher3 teacher4 teacher5 teacher6
    05-05-2019 T1 T2 T3
    04-04-2019 T1


    I'm unfortunately not very familiar with complex queries and haven't found a solution online that I know how to adapt to my needs.
    I would appreciate any help with this very much!

    Thank you in advance
    LuLeBe
    Last edited by LuLeBe; 09-01-2019 at 05:20 AM. Reason: added table name

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Look at theSimilar Threads

    links at the bottom of the page for ideas.
    Good luck.

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

Similar Threads

  1. Merge Multiple Rows To Single Row
    By Juan4412 in forum Programming
    Replies: 12
    Last Post: 05-23-2017, 09:43 AM
  2. Replies: 5
    Last Post: 10-22-2016, 12:30 PM
  3. Replies: 5
    Last Post: 04-10-2012, 08:53 AM
  4. Replies: 2
    Last Post: 01-02-2012, 06:46 PM
  5. Replies: 5
    Last Post: 12-01-2011, 05:38 PM

Tags for this Thread

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