dimanche 21 mars 2021

I need to combine more than 2 records into one in MS Access (Without using Function ConcatRelated)

I would like to combine more than 2 records into one combined in MS Access (Without using Function ConcatRelated). I don't mind hard-coded it, as the maximum records is 9.

Right now I am only able to combine 2 records by using this set of SQL:

First([SE].[Service_Type]) & IIf(Count([SE].[Service_Type])>1,", " & Last([SE].[Service_Type])) AS ServicesPerformed, 

SE (Table) & Service_Type (Attribute)

The output is as follow:
ServicesPerformed
Delivery, Handyman work
Plumbing, Delivery
Moving, Cleaning

But I need to show output like this:
ServicesPerformed
Delivery, Handyman work, Plumbing, Moving, Cleaning
Plumbing, Delivery, Moving
Moving, Cleaning, Delivery

I am looking to combine more, let say 9 records at most. Would really appreciate it if someone can help me with this newbie out here. Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire