Disclaimer The opinions expressed herein are my own personal opinions and do not represent RBA Consulting's view in anyway.
Here is a simple example of a pivot function in SQL 2005
UserName
Class
Week_Date
Hours
CategoryName
IsBillable
CategoryAppr
INSERT
Select
--SELECT Final.UserName,Final.Week_Date, SUM(Final.CB) ,SUM(Final.AD),SUM(Final.PTO)
--from
--(SELECT UserName,Week_Date, [CB] as CB, [AD] as AD, [PTO] as PTO
-- FROM #UserTime AS P
-- PIVOT
-- (
-- Sum(P.Hours)
-- FOR P.CategoryAppr
-- IN([CB], [AD], [PTO])
-- ) AS Pivoted
--) as Final
--Group By Final.UserName,Final.Week_Date
SELECT
Group
DROP
Remember Me