2013-03-25 14 views
6

Ich habe eine Tabelle wie folgt aus:Concatenate Aufzeichnungen und GROUP BY in Access

title    part     desc 
Blah This   1      This begins the 
Blah This   2      example table. 
Some Record   1      Hello 
Another    1      This text extends a bit 
Another    2      further so it is in 
Another    3      another record in the 
Another    4      table 

In Access, ich suche eine Abfrage/SQL GROUP BY title und verketten die desc Feld zu bauen, so dass es so aussieht :

title    desc 
Blah This   This begins the example table. 
Some Record  Hello 
Another   This text extends a bit further so it is in another record in the table 

Wie kann dies mit nur SQL (keine VBA/Skripte) getan werden? FOR XML PATH scheint in Access nicht zu funktionieren, nur SQL Server. Ich habe VBA hier How to improve efficiency of this query & VBA? versucht, aber es ist einfach zu langsam.

Oder kann eine Funktion verwendet werden, die nicht kontinuierlich ausgeführt wird, während die Abfrage bereits geöffnet ist?

+0

Werfen Sie einen Blick darauf. Nicht sicher, ob FOR XML PATH in Access funktioniert, aber wenn dies der Fall ist, ist dies Ihre Antwort: http://stackoverflow.com/questions/14082863/concatenation-of-strings-by-for-xml-path –

+1

Es gibt keine Möglichkeit zu Mach das mit nur Sql in Access. [Sie müssen eine Funktion verwenden] (http://wiki.lessthandot.com/index.php/Concatenate_a_List_into_a_Single_Field_%28Column%29). –

Antwort