example
exec usp_first_day_and_last_day_of_week 2015,42
result
Kamel AL GAZZAH,
2015-11-10 (first published: 2015-10-12)
example
exec usp_first_day_and_last_day_of_week 2015,42
result
create procedure usp_first_day_and_last_day_of_week(@y as int,@w as int) as begin --Kamel Gazzah 12/10/2015 --kamelgazzah@gmail.com declare @fd as datetime set @fd='01/01/'+convert(varchar(4),@y) select @w "week",dateadd(day,8+7*(@w-2)-datepart(weekday,@fd),@fd)"first day",dateadd(day,14+7*(@w-2)-datepart(weekday,@fd),@fd)"last day" end
You rated this post out of 5. Change rating
Function for Getting Interval Dates by days,months,years for particular week number, for particular month, for particular date between 1 to 31. etc...
All in One Date Interval Related Function.
2016-06-27 (first published: 2015-11-27)
1,828 reads
He admits it wasn't his idea but his head sure wishes it was. SQL Server MVP Jeff Moden explains a wonderful, super simple, very high performance formula that will calculate ISO Week Numbers. If you're "stuck" with SQL Server 2005 or less, you're going to like this a whole lot!
2015-10-23 (first published: 2013-04-08)
29,524 reads
2020-02-27
18,412 reads
In this piece, learn about changes in UK holidays and get a script to calculate them.
2019-07-15
3,014 reads
2019-07-04
881 reads