0

I have a table in access which contains two fields, the first field is ids to some products and the second field is ids to the parts used to make the product. So, the product id can be listed more than once. I need to make a query which gives me unique product ids in one field and part ids separated by "," in second field. Any Ideas on how to do it? Thanks in advance.

1 Answers1

0

Using Ado concat:

  SELECT [Id], 
          ConcatADO("SELECT [PartId] FROM MYTABLE
                     WHERE [Id]=" & [Id],", "," : ") AS Parts
   FROM MYTABLE
   GROUP BY [Id], 2;
Ali Sheikhpour
  • 10,475
  • 5
  • 41
  • 82