i am using access 2007 and i am trying to combine multiple rows into one. i am using the code from this site but i continue to get this error:
Compile error in query expression. last(concat(dat a1.company,data 1.esi))
i tried using max instead of last same error however.
my query is as follows
Compile error in query expression. last(concat(dat a1.company,data 1.esi))
i tried using max instead of last same error however.
Code:
Public Function Concat(strCOMPANY As String, _ strESI As String) As String Static strLastCOMPANY As String Static strESI As String If strCOMPANY = strLastCOMPANY Then strESI = strESI & ", " & strESI Else strLastCOMPANY = strCOMPANY strESI = strESI End If Concat = strESI End Function
Code:
SELECT data1.COMPANY, Last(Concat(data1.[COMPANY],data1.[ESI])) AS ESIs FROM data1 GROUP BY data1.[COMPANY];
Comment