SET DATEFIRST 1; DECLARE @sDate date DECLARE @eDate date;...

0

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

SET DATEFIRST 1;
DECLARE @sDate date
DECLARE @eDate date;
SET @sDate = '2018-01-01';
SET @eDate = '2025-12-31';

;with GetDates As  
(  
    Select DATEADD(day, -1, @sDate) as TheDate
    UNION ALL  
    Select DATEADD(day, 1, TheDate) as TheDate from GetDates  
    where TheDate < @eDate

)
Select DATEPART(iso_week, TheDate) as WeekOfYear, TheDate from GetDates option (maxrecursion 0);

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results