Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Is this possible?

Author  Topic 

divided
Starting Member

12 Posts

Posted - 2007-10-01 : 16:26:18
Basically I need to create a report in this format.

On the x axis, needs to be a list of all of our offered courses (I work at a school) so it would look like

Sd 101 sd 102 sd 103 ect... There are 500+ courses

On the Y axis needs to be

PeopleId FirstName LastName Grade


I have a report with all the people i need, and i have a report with all the avaialble classes, but i have NO idea if/how i can pull this data to create the format i need. In our tables the class lists are stored in a column, I cant filter based on classes taken, because i need a list to display ALL avaialbe classes whether taken or not and this list needs to have the grade recieved for that class in the appropriate column. So the output would look like

---------------------Sd 101------------ sd 102-----------------sd 104

1234 John Doe ---------A+

1253 Jane Doe --------------------------D

1242 JOsh Doe ----------B+ -------------------------------------A-


I added the ---- To show the formatting better of what i would need. I can write the queries to pull the appropiate data, but i just need to know if its possible to AUTOMATICALLY format the way i need or what i have to do to get it that way, if its even possible.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-10-01 : 19:34:05
search for cross tab or pivot in this site. Lots of example


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-02 : 04:34:50
Maybe start here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Pivot+table2,Pivot+table,Dynamic+CrossTabs,Dynamic+Cross-Tabs
Go to Top of Page
   

- Advertisement -