I am trying to fix a function which returns the number of weeks in a given year.
Here's how it looks:
Function GetWeekNo(date)
weekOfYear = DatePart("ww", DateValue(date), vbMonday, vbFirstFourDays)
If weekOfYear > 52 Then
If DatePart("ww", DateValue(date) + 7, vbMonday, vbFirstFourDays) = 2 Then
weekOfYear = 1
End If
End If
GetWeekNo = weekOfYear
End Function
When this function is given the date 12-31-2010 it returns 52. There are 53 weeks in 2010.
Note: I have no experience with classic ASP, what-so-ever.