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

Difficult record set return

Status
Not open for further replies.

Larrabbb

Programmer
Apr 23, 2003
9
US
I want to return a data set that consists of the following

Chan1 Chan2
Apr 116 1
May 112 5

Here is the data set that I am pulling from

CatID Channel mth Disp_mth yr vol
3502 Chan1 4 April 2003 116
3502 Chan2 4 April 2003 1
3502 Chan1 4 May 2003 112
3502 Chan2 4 May 2003 5

Additionally, for any given month, there may be any number of items. So the data set that is returned may look like this:

Chan1 Chan2 Chan3 Chan4 Chan5 Chan ‘n’
Apr 116 1 10 12 22 n
May 112 5 13 5 6 n

Any thoughts on this? I have more information if needed.
 
Don't crosspost. Make a search for cross tab queries in the SQL server forum(s)
 
You can't solve this problem using an SQL statement, since the result set must have a defined (fixed) set of columns.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top