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)
 Using the crosstab sp

Author  Topic 

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-10-22 : 16:23:26
I'm using the cross tab sp from:
http://www.sqlteam.com/item.asp?ItemID=2955

EXECUTE sp_crosstab 'SELECT EmployeeID FROM dbo.TimeCardItems WHERE WeekEndingDate >= ''10/13/2002'' GROUP BY EmployeeID', 'AVG(Hours)', 'CONVERT(NVARCHAR,WeekEndingDate,101)', 'TimeCardItems'

I do I get the columns in order

10/13/2002 10/20/2002 10/27/2002 ...etcc.....

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-22 : 16:25:30
Check the comments section, someone wrote a modified version that orders the pivot columns.

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-10-22 : 17:06:13
I didn't find any?

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-22 : 17:18:01
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6216

Posted by cwburke, it's the last reply on the first page.

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-10-22 : 19:03:36
Thanks Rob.



Go to Top of Page
   

- Advertisement -