Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL

Author  Topic 

avmreddy17
Posting Yak Master

180 Posts

Posted - 2010-01-31 : 22:12:01
What is a good way to check if a given date is a third Saturday?
Thx
Venu

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-01-31 : 22:15:47
see http://weblogs.sqlteam.com/peterl/archive/2009/06/17/How-to-get-the-Nth-weekday-of-a-month.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-01 : 01:26:22
or

declare @date datetime
set @date='2010-02-21'
if day(@date) between 15 and 21 and datename(weekday,@date)='saturday'
print 'Third saturday'
else
print 'Not a Third saturday'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -