View Full Version : Column Values to Rows?


RHubbard
08-25-2006, 03:32 AM
I am trying to devise a way to display query results in a row instead of a column. The table on which the query is built has this structure:

Column1: Index (pkf)
Column2: Group (int)
Column3: Position (int)
Column3: ItemCode (txt)

When I do a select query, the data comes back like this:

Group Position ItemCode
1 1 A
1 2 B
1 3 C
1 4 D
1 5 E
1 6 F
Etc.

I want to arrange the data this way:

1 A B C D E (Etc)

I keep thinking that a cross-tab query is the answer, but all I seem to be able to do is to get counts of Position 1, 2, 3 Etc.

I’m baffled. Does anyone have a suggestion?

Thanks,

Rick

KenHigg
08-25-2006, 03:39 AM
The only way I have found to do this is in the post # 7 sample db found in this thread:

http://www.access-programmers.co.uk/forums/showthread.php?t=99777

RHubbard
08-25-2006, 04:16 AM
Hi Ken-

Thanks for the hint. I looked at the sample DB and I might be able to make this work (in a convoluted sort of way).

The only problem is, I can't seem to find where the code is that makes this work. What am I missing?

Rick

RHubbard
08-25-2006, 04:23 AM
Ooops- Never mind, I found it!

Thanks again!

Rick

KenHigg
08-25-2006, 04:23 AM
It's in Module1 in a proceedure named s_runMe.