Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    58

    Unanswered: Compressed crosstab query

    I have a table with the following layout:

    studentID, Subject
    1, English
    1, Maths
    1, Science
    1, Art
    1, Business
    2, English
    2, Maths
    2, Science
    2, History
    3, English
    3, Maths
    3, Science
    3, RE
    3, Music

    I want to convert this table so the information is displayed as follows:

    studentID, subject1, subject2, subject3, subject4, subject5.
    1, English, Maths, Science, Art, Business.
    2, English, Maths, Science, History, .
    3, English, Maths, Science, RE, Music.

    The closest I have found is using a crosstab query but this lists the subject names as column headings and spreads the results across a wide datasheet, leaving a lot of blank cells.

    Is there any way to achieve this?

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    Try having a look at this

    Regardz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •