el_marcondon
May 28th, 2001, 04:18 PM
How do I calculate in which week (first weekday monday) of the month is the first and the third Monday? IŽd like to get it like: "28 May 2001 => 4th May week" or "4 Jun 2001 => 1st June week".
Thank you
cksiow
May 29th, 2001, 04:39 AM
public Function DayInWhichWeek(byval Day as Long, byval Month as Long, byval Year as Long) as Long
Dim dayWeek as Long
Dim dDate as date
dDate = CDate(MonthName(Month) & " 1," & CStr(Year))
dayWeek = Weekday(dDate)
DayInWhichWeek = ((dayWeek + Day - 2) \ 7) + 1
End Function
HTH
cksiow
http://vblib.virtualave.net - share our codes