Stefano
Stefano

Reputation: 199

Access: query for concatenation of texts of same field

From the table Table, I would like to build a query that gives me the table Query.

The first issue is to build Query.Note as a concatenation of Table.Note.

Te second issue, more difficult, is to concatenate Table.Project + ": " + Table.Note each time that Table.Note is not empty.

Some clues?

For my needs, it is enough to solve the first issue. The second one would be great to have.

I am open to VBA-solutions.

Thanks in advance!

enter image description hereenter image description here

Upvotes: 0

Views: 54

Answers (1)

donPablo
donPablo

Reputation: 1959

This involves using the "GetList" Function that is found Microsoft Access condense multiple lines in a table.

Please note that Table and Query are reserved words, and that Note needed to be made plural as Notes.

SELECT 
  T2.Client
  ,GetList("Select Project & "": "" & Note From myTable as T1 where T1.Client  =  """ &  T2.Client & """","","; ") AS Notes

FROM myTable as T2
GROUP BY T2.Client;

Upvotes: 1

Related Questions