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 2008 Forums
 Transact-SQL (2008)
 transpose

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-07-21 : 06:25:25
can v transpose the results executed fom one sp column and rows

for ex:

executed my sp-result:

weekday intime outime total
monday 9 17 8
wednesday 10 16 6


like that

but i want result like below:

monday tuesday wednesday thursday friday saturday
in out tot in out tot in out tot
9 17 8 - - - 10 16 8


like that

is it possible in query?

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2010-07-21 : 09:05:18
Put the results into a #temp table and PIVOT them.
Go to Top of Page
   

- Advertisement -