How to combine texts values from multiple rows into a single cell in access queries
Can You Please help me in doing this: Please look at images below
1 Answer
Since you mentioned you now have the ConcatRelated() function, you can use this query, which simply sums the Discount column for all rows, and uses ConcatRelated to concatenate the Reason values for all rows:
SELECT Sum(Discount) AS Total_Discounts , ConcatRelated("Reason", "Table1") AS The_Reasons
FROM Table1;
If you would like the query to create the Table2 table from your second screenshot, just add an INTO clause:
SELECT Sum(Discount) AS Total_Discounts , ConcatRelated("Reason","Table1") AS The_Reasons
INTO Table2
FROM Table1; 4