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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a table with two fields. Th

Status
Not open for further replies.

awhitsel

Programmer
Feb 22, 2001
80
US
I have a table with two fields. The first field is a "record number" and the second field is a separate "catalog number".

I want to be able to view the items from the second field across so that they are in a separate field, so that there is a unique "record number" in each record with the "catalog numbers" read from left to right.

If you don't understand what I'm asking about, look below:

My records currently look like this:

REC_NUM CAT_NUM
----------- -----------
1 1
1 2
2 3
2 4
2 5
3 6
4 7
4 8

I want to be able to read my table like this:

REC_NUM CAT_NUM1 CAT_NUM2 CAT_NUM3
----------- ------------- ------------- -------------
1 1 2
2 3 4 5
3 6
4 7 8

I tried doing this in Access, and it went haywire.

Is there a way that this can be done in a SQL Server query?

Any help would be greatly appreciated.

Thanks.
 
Please disregard. This message was sent to the wreong forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top