KirbyWallace
Programmer
Hi All!
I need to transform this:
in this example, the type is 1=vac, 2=sick, 3=paid leave
Into this:
I understand this is a pivot table operation, but I've never done one before. Any ideas?
I'm looking for TSQL code - a SELECT statement approach.
Thanks for any help you can offer.
I need to transform this:
in this example, the type is 1=vac, 2=sick, 3=paid leave
Code:
Date Hours Type
8/21/2009 3.5 2
8/21/2009 4.5 3
11/16/2009 8 1
11/17/2009 8 1
11/18/2009 8 1
Into this:
Code:
Date Vac Sick PaidLeave
8/21/2009 0 3.5 4.5
11/16/2009 8 0 0
11/17/2009 8 0 0
11/18/2009 8 0 0
I understand this is a pivot table operation, but I've never done one before. Any ideas?
I'm looking for TSQL code - a SELECT statement approach.
Thanks for any help you can offer.