1

I have an MS Access query: Structure

Which gives me this output: Output.

I need to marge Med_Name field into one single string. Like : "Test 3, Test 2, Test 3, Test 4, Test 6, Test, ,"

I don't have any criteria or more than one table, please help me to convert all of Med_Name field into one single row/sentence separated by comma.

I NEED ALL THE ROWS CONCATENATED INTO ONE ROW WITHOUT ANY WHERE CLAUSE OR KEY.

I need to use the merged value into a textbox and copy that to the clipboard.

I'm not good at posting questions, extremely sorry for that and thanks a lot to all.

June7
  • 19,874
  • 8
  • 24
  • 34
Imtiaz
  • 143
  • 1
  • 1
  • 8
  • 2
    agreed, see http://allenbrowne.com/func-concat.html function – Van Ng Jul 08 '19 at 06:45
  • People here are too skillful to understand :( All the answers available here are using more than one table and using "WHERE" clause. I don't need those. I just need to concatenate all the data from a single field (Med_Name) into one concatenated comma separated string :( – Imtiaz Jul 08 '19 at 16:44
  • 1
    What you want requires VBA code. Allen Browne's function is commonly used for this. The second link shows answer using only one table. If you don't want to use the function's WHERE argument, then don't (but unless you use the filtered query as source for the function, I doubt you will like the result). Make an attempt and when you have specific issue, post question. – June7 Jul 08 '19 at 17:18
  • 1
    Function can be called from textbox ControlSource. However, I just tested with a saved parameterized query as the function's source and it fails. Can try Gustav's option provided in first link. Point is, filter must be applied somewhere. – June7 Jul 08 '19 at 17:34
  • Thanks a lot, June7. I'll try tomorrow and inform. – Imtiaz Jul 08 '19 at 20:02
  • 1
    @ImtiazSiddique you can "1=1" condition in `WHERE` clause, in order to select all rows, I think – Van Ng Jul 10 '19 at 12:01

0 Answers0