Help with this query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rhaazy

    Help with this query

    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.
  • rhaazy

    #2
    Re: Help with this query

    On Feb 13, 12:35 pm, rhaazy <rha...@gmail.c omwrote:
    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..

    Comment

    Working...