0

I would like to combine like rows based on StudentID and Subject in the table below.

StudentID Subject Code
393438 Math [AF15]
393438 Math [DS1.4]

I would like for the code column to join the unique values into one field. Example: The above table would become:

StudentID Subject Code
393438 Math [AF15];[DS1.4]

I have tried to merge the table with another table with unique records for studentid and subject. I am fairly new at MS Access and still learning. Any help would be greatly appreciated.

  • Does this answer your question? [Allen Browne's ConcatRelated() Error 3061: Too few parameters](https://stackoverflow.com/questions/54789423/allen-brownes-concatrelated-error-3061-too-few-parameters) – June7 May 11 '23 at 17:28

1 Answers1

1

Use my fast function DJoin:

SELECT 
    Student.StudentID, 
    Student.Subject, 
    DJoin("[Code]","Student","",";") AS Codes
FROM 
    Student
GROUP BY 
    Student.StudentID, 
    Student.Subject;

Output:

enter image description here

Gustav
  • 53,498
  • 7
  • 29
  • 55