Trying to figure out the best way to pivot a table dynamically on the date field in the following table. the issue is these dates change so I cant hard code them in the pivot statement.
id value date
1 55 2012-12-29 00:00:00:00
1 54 2012-10-29 00:00:00:00
1 89 2013-02-02 00:00:00:00
2 45 2012-12-29 00:00:00:00
2 54 2012-10-29 00:00:00:00
4 78 2012-12-29 00:00:00:00
4 90 2012-10-29 00:00:00:00
4 23 2012-10-29 00:00:00:00
I want the output to look like this
id 2012-12-29 00:00:00:00 2012-10-29 00:00:00:00 2013-02-02 00:00:00:00
1 55 54 89
2 45 54 null
4 78 90 23