I want the first day and last day of week and then look at last day of week to compare with cureent date, if passed then do calculations.
From date I can get by this:
DECLARE @Date datetime
SET @Date = getdate()
SET DATEFIRST 1
SELECT @@DATEFIRST AS '1st Day', DATEPART(dw, @Date ) AS 'Today'
, dateadd(dd, 1 - DATEPART(dw, @Date ), @Date -7) as FirstDateofWeek
, dateadd(dd, 7- DATEPART(dw, @Date ), @Date -7) as LastDateofWeek
, cast(datepart(wk, @Date) as varchar) as weeknumber
But, I don't have date and have only week number 40 ( no date), how do I get first day and the last day of week number 40?