Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Vertical to Horizontal

Author  Topic 

NTC
Starting Member

21 Posts

Posted - 2008-05-07 : 13:57:59
Have this in Table:
A 2ZS
A RRT
A ABC
B 22R
B 123
C WWW

Need this in query result:
A 2ZS, RRT, ABC
B 22R, 123
C WWW

Driven purely by need to get onto a label for printing and am very space constrained. Would greatly appreciate assist...the comma between values is not mandatory...thanks in advance

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-05-08 : 02:25:02
Have a look here:

http://office.microsoft.com/en-gb/access/HA010345801033.aspx?pid=CL100570041033
Go to Top of Page

NTC
Starting Member

21 Posts

Posted - 2008-05-08 : 10:50:55
appreciated; but don't find pivot table or a crosstab to be viable source for label due to size constraints and managing/minimizing space between values. I could be wrong on this though. Played a little with it and don't use them often but the results were not favorable.

I did find a great method from Duane Hookom that is a combo of sql and vba
http://www.rogersaccesslibrary.com/OtherLibraries.asp

The naming of it is a little misleading: Generic Function To Concatenate Child Records

But does a great job in the vertical to horizontal task.
Go to Top of Page
   

- Advertisement -