0

I am looking to concatenate this table using http://allenbrowne.com/func-concat.html:

[Test2 Query2]

Cc       Product Code  
1        a  
1        b  
2        c  
3        d  
3        e  
4        f  
4        g  
4        h  

into

[Test2 Query3]

Cc       Product Codes  
1        a, b  
2        c  
3        d, e  
4        f, g, h  

My current SQL view is this:

SELECT [Test2 Query2].Cc, 
ConcatRelated("[Product Code]", "[Test2 Query2]", 
              "[Test2 Query2].Cc = """ & [Test2 Query2].Cc & """") AS [Product Codes] 
FROM [Test2 Query2];

When I run this however, it returns "Error 3464: Data type mismatch in criteria expression".

*Note: Product Code is stored as a short text and Cc is a number.

I have also tried referencing Concatenating multiple rows into single line in MS Access to no avail.

Any help is appreciated!

Andre
  • 26,751
  • 7
  • 36
  • 80
Nick T
  • 63
  • 8
  • 1
    Try updating `"[Test2 Query2].Cc = """ & [Test2 Query2].Cc & """"` to `"[Test2 Query2].Cc = " & Cc` – Mike Jun 03 '19 at 19:26
  • Did you mean to say "Product Code is stored as a short text"? Doubled quote (or an apostrophe) delimiters are for text fields, not number type. Use # for date field parameters. – June7 Jun 03 '19 at 19:55

0 Answers0