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.
Use 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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With