I wrote this statement which gives me a start and end week number.
SELECT DATEPART(wk, '1/11/2007') as StartWeek, DATEPART(wk, '1/28/2007') as EndWeek
produces
StartWeek EndWeek
----------- -----------
2 5
I am trying to modify or just create a statment to use in a derived table join to producce the results 2,3,4,5 which are the weeks including and between the start and stop dates.
The results hopefully will be in one column as shown below
weeks
------
2
3
4
5
Thanks
Dan
SELECT DATEPART(wk, '1/11/2007') as StartWeek, DATEPART(wk, '1/28/2007') as EndWeek
produces
StartWeek EndWeek
----------- -----------
2 5
I am trying to modify or just create a statment to use in a derived table join to producce the results 2,3,4,5 which are the weeks including and between the start and stop dates.
The results hopefully will be in one column as shown below
weeks
------
2
3
4
5
Thanks
Dan