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
 SQL Server Development (2000)
 SQL support for cross-tab queries

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-10 : 07:48:11
Badr writes "For solving problem like this
For example I have :
Customer table
|CustomerID| |month| |Order_qty| |year|
-1005- -1- -10- -2004-
-1005- -2- -20- -2004-
-1005- -4- -10- -2004-
-1005- -5- -2- -2004-
-1005- -7- -11- -2004-
-1005- -10- -100- -2004-
-1005- -12- -30- -2004-
-1007- -2- -10- -2004-


and I want my report to Display like this:

|CustomerID| |Jan| |Feb| |Mar| |Apr| |May| |Jun| |July| |Aug| |Sep| |Oct| |Nov| |Dec|
1005-- 10-- 20-- 0— 10-- 2-- 0— 11-- 0-- 0-- 100-- 0-- 30--"

I have to use dynamic SQL. Is there any simple way after introduction of SQL 2003 standard which SQL server has introduced.

Please donot answer famouse case when ---- else --- end
styled solution.I want to have virtually infinite number of columns

"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-10 : 07:46:16
http://www.sqlteam.com/searchresults.asp?SearchTerms=cross+tab
Go to Top of Page
   

- Advertisement -