I have a data set that I would like to represent sort of like a pivot table. My challenge is the system that I am working is does not support pivot, cursor or any variables\temp tables, it has to be done in a relatively basic query.
So my data looks like this.
Email Project EndDate EstHours ActualHours
-----------------------------------------------------------
joe@gmail.com Proj 1 03/1/2018 10 12
joe@gmail.com Proj 1 03/8/2018 8 10
joe@gmail.com Proj 1 03/14/2018 13 17
jay@gmail.com Proj 1 03/1/2018 10 12
jay@gmail.com Proj 1 03/8/2018 8 10
jay@gmail.com Proj 1 03/14/2018 13 17
I would like my output to look like this
Email Project 03/1/2018 03/08/2018 03/14/2018
-----------------------------------------------------------
joe@gmail.com Proj 1 10,12 8,10 13,17
jay@gmail.com Proj 1 10,12 8,10 13,17
In this example I only show 3 weeks worth of estimates but I have available up to 52 weeks. Is there a way to transform this data whilst selecting the number of weeks that I would like to show? Hard coding the number of weeks if fine.
Thanks