0

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

3limin4t0r
  • 19,353
  • 2
  • 31
  • 52
Stefano
  • 209
  • 2
  • 10
  • 34

1 Answers1

1

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;
donPablo
  • 1,937
  • 1
  • 13
  • 18