Displays range of dates - CalendarApril 11, 2004
>>Script Language and Platform: SQL Server 2000 Author: MAK create function dbo.calendar (@startdate datetime, @enddate datetime) returns @calendartable TABLE (id int identity(1,1), date datetime, month varchar(12), day varchar(10)) as BEGIN --Author: MAK --Objective: To display the calendar --Date: April 1, 2002 declare @startdate1 datetime set @startdate1 = @startdate while @enddate >=@startdate1 begin insert into @calendartable (date,month,day) values (@startdate1,datename(month,@startdate1),datename(dw,@startdate1)) set @startdate1 =@startdate1+1 end return END
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 |