1

How can I get the exact week number if my date range is from Friday to Thursday nextweek? I used this code

datepart(wk,t.date) as workweek

but the week number is different, maybe because the format that I want to get is from Friday to Thursday nextweek. I hope somebody can answer. TIA!

1 Answers1

0
SET DATEFIRST 5; -- Set Friday as first day of the week
Select datepart(wk,t.date) -1 as workweek
From yourTable as t
Ahmed Saeed
  • 831
  • 7
  • 12