By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

Help with this query

P: n/a
I have a table that looks like this:

Key Name ID
1 Joe A
2 Sam A
3 Bill A
4 Bob B
5 Pat B
......

I need a query that selects the top 5 names where ID = A

However, this query returns 5 rows. I need a query that instead
returns the result as 5 columns. I think the name of what I want is a
crosstab query, I just am unsure how to accomplish what I want... Any
help would be greatly appreciated.
Feb 13 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Feb 13, 12:35*pm, rhaazy <rha...@gmail.comwrote:
I have a table that looks like this:

Key * * * * * * * Name * * * * * * * * ID
1 * * * * * * * * * *Joe * * * * * * * * * * A
2 * * * * * * * * * *Sam * * * * * * * * * *A
3 * * * * * * * * * *Bill * * * * * * * * * * *A
4 * * * * * * * * * *Bob * * * * * * * * * *B
5 * * * * * * * * * *Pat * * * * * * * * * * B
.....

I need a query that selects the top 5 names where ID = A

However, this query returns 5 rows. *I need a query that instead
returns the result as 5 columns. *I think the name of what I want is a
crosstab query, I just am unsure how to accomplish what I want... Any
help would be greatly appreciated.
Let my clarify a bit more. What I want as a result is:

Name1 Name2
Name3 Name4 Name5
IDA Joe Sam
Bill etc.. etc..
Feb 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.