Larry Brister
asked on
SQL Pivot
I have a table with the following columns and example data
taskName Number runDate
tsk1 1000 2012-08-21 11:53:10.000
etc...
I want to do a select based on last 2 weeks and return the following considering that today is 8/21/2012
TaskName 8/21 8/20 8/19 etc
tsk1 1000 56 253
tsk2 0 2000 300
etc...
taskName Number runDate
tsk1 1000 2012-08-21 11:53:10.000
etc...
I want to do a select based on last 2 weeks and return the following considering that today is 8/21/2012
TaskName 8/21 8/20 8/19 etc
tsk1 1000 56 253
tsk2 0 2000 300
etc...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Long...but a viable solution
http://www.simple-talk.com/blogs/2007/09/14/pivots-with-dynamic-columns-in-sql-server-2005/