Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatinate values from a column into a single line??

Status
Not open for further replies.

brettatexplace

Technical User
Mar 8, 2002
60
0
0
CA
Help! Is there something simple to do this. If I have a qry like this...
ID# Time
6 X
6 Y
6 z
7 g
7 b
8 e

how can I run a query/vba to get it grouped for my ID# so that it looks like this...
ID# Times
6 x,y,z
7 g,b
8 e

I am trying to get all my times in a single string value!

Thanks to all in advance!
 
Or try the generic concatenate function at faq701-4233.
Code:
SELECT [ID#],
Concatenate("Select [Time] From [tblA] Where [ID#]=" & [ID#]) as Times
FROM [tblA]
GROUP BY [ID#], Concatenate("Select [Time] From [tblA] Where [ID#]=" & [ID#]);

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Problem SOLVED! THANKS TO ALL, I actually found a Cacatenate function about three listings under mine on another persons question just after I sent mine. (The one dhookom sent me!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top