I am using sql server 2005. I just want to know is there something we can get the week number for the particular month. Example Date = '2008-10-16' Is there something we can have SELECT WEEK(Date). Or any better suggestion.
Is there a way i can get week for the month. Is gives me 42 i guess thats the week of the year.
jazzrai
2008-10-14 22:42:30
+1
A:
You can do it this way:
SET @weeksinmonth=datediff(week, @date, @lastdate) + 1
That is a copy-and-paste out of one of my stored procedures.
BoltBait
2008-10-14 22:43:16