balars_2000 (6/9/2009)
I would display 0's to indicate there was no data during that particular week.--Ta
Then you need a complete list of dates to join against for any given year...
[font="Courier New"]DECLARE @FirstDate DATETIME
SELECT @FirstDate = '20090104'
SELECT v.Number AS Week,
DATEADD(wk, v.Number ,@FirstDate) AS StartDate,
DATEADD(wk, v.Number+1 ,@FirstDate) AS NextDate
FROM Master.dbo.spt_Values v
WHERE Type = 'P'
AND Number BETWEEN 0 AND 51[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.