I have the following view in SQL Server 2008.
DEPT | EMP_ID | EMP_NAME | P_DATE | HOURS_WORKED
I want the view to be this way:
DEPT | EMP_ID | EMP_NAME | 2012-09-28 | 2012-09-29 | 2012-09-30 | 2012-10-01 ...
where the above date column header is P_DATE below which is "Hours_Worked" values of that employee on that particular date.
Like
2012-09-28
09:00:00
10:00:00
I am not sure whether I could achieve it using Pivot.
Please go to this link for clear understanding : SQL Server View Snapshots