Jump to content


SQL - Find Fourth Monday, Tuesday .. of given date


  • Please log in to reply
No replies to this topic

#1 vavjeeva

vavjeeva

    Bronze Member

  • Hyper Member
  • PipPipPipPip
  • 386 posts
  • Gender:Male
  • Location:INDIA
  • Interests:Surfing / Exploring Unknows Things

Posted 06 October 2004 - 01:08 PM

Hi guys,

i need a sql query to find out Fourth Monday, tuesday or... in a Given Date..

i have a query to find out fourth Friday of Given Date

select (28-((Datepart(weekday, DATEADD(mm, DATEDIFF(mm,0,getdate()), 0) ))%7))

For example, If the Date is Oct 2004 ,

the Result is 22

the same way i want to to find out for all other days..

thanks in advance




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users