>>Script Language and Platform: SQL Server 2000
For a given year and week, this function will return the date of the first day of that week.
set datefirst 1
Create function dbo.udf_Mondayofaweek(
declare @date varchar(10)
declare @firstdayofweek datetime
set @date =convert(varchar(10),convert(datetime,@date)
set @firstdayofweek =dateadd(ww,@week-1,@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...
Back to Database Journal Home