The following sql function will return the Fourth Monday of the Current Month.
CREATE FUNCTION [dbo].[GetFourthMondayOfCurrentMonth]
(
)
RETURNS DATETIME
BEGIN
declare @Today as datetime
declare @FirstMonday as datetime
declare @FourthMonday as datetime
set @Today = getdate()
select @FirstMonday = DATEADD(wk, DATEDIFF(wk,0,dateadd(dd,6-datepart(day,@Today),@Today)),0)
set @FourthMonday = DATEADD(day,21,@FirstMonday)
return @FourthMonday
END
Wednesday, November 12, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment