Beginning date of any week in a yearAugust 9, 2004
>>Script Language and Platform: SQL Server 2000 Usage: select dbo.udf_mondayofaweek(1,2001) --results 2001-01-01 00:00:00.000 select dbo.udf_mondayofaweek(22,2003) --results 2003-05-26 00:00:00.000 Author: MAK set datefirst 1 go Create function dbo.udf_Mondayofaweek( @week int, @year varchar(4)) returns datetime as begin declare @date varchar(10) declare @firstdayofweek datetime set @date='01/01/'+@year set @date =convert(varchar(10),convert(datetime,@date)
Disclaimer: We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
"as -is", without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose...
Disclaimer Continued
Back to Database Journal Home |