Here's what I'm using so far to determine a given on Sunday what weekend of the month it is:
TodaysDate = date()
intWeekDay = WeekDay(TodaysDate)
CurrentDay=day(date())
CurrentMonth=month(date())
CurrentYear=year(date())
If intWeekDay = 7 then
if CurrentDay < 8 Then
strWeekend = "WEEKEND1"
end if
if CurrentDay > 7 and CurrentDay < 15 then
strWeekend = "WEEKEND2"
end if
if CurrentDay > 14 and CurrentDay < 22 then
strWeekend = "WEEKEND3"
end If
if CurrentDay > 21 and CurrentDay < 29 then
strWeekend = "WEEKEND4"
End If
if CurrentDay > 28 then
strWeekend = "WEEKEND5"
End if
End If
What it can't determine is, on the 4th weekend, if there is a 5th weekend for the same current month. I have a script that needs to run on the last weekend of each month. I'm trying to determine from the date of the last day of thge current month, what weekday it is. Something like:
what is the last day of the current month and what weekday does it fall on?
Hope this helps, I'm sort of at a loss for where to start.