If I have a YEAR and a WEEK number, what's a clean way to construct a DATE from this? I'd prefer it if the day of the week could be a Monday.
YEAR
WEEK
DATE
Use DATEADD
DATEADD
Rextester Demo
DECLARE @y INT = 2015, @w INT = 37; SELECT [StartOfWeek] = DATEADD(wk,DATEDIFF(wk,7,CAST(@y AS NVARCHAR(100))) + (@w-1),7);
2.1m questions
2.1m answers
60 comments
57.0k users