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

 All Forums
 Old Forums
 CLOSED - General SQL Server
 insert problem

Author  Topic 

Yak Posting Veteran

51 Posts

Posted - 2006-06-14 : 19:23:31
Hi i want to convert rows to columns in my table.
my rows are jan,feb,mar,apr,.....dec
i want to convert them into columns

how shall i do that?????

Constraint Violating Yak Guru

366 Posts

Posted - 2006-06-14 : 20:39:46
Use the CASE statement:

CASE WHEN YourColumn = 'jan' THEN ... END AS [jan],
CASE WHEN YourColumn = 'feb' THEN ... END AS [feb],
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 2006-06-15 : 03:00:48
Read about Cross-tab Reports in sql server help file
Also refer


Failing to plan is Planning to fail
Go to Top of Page

- Advertisement -