Function LastDayInMonth(iMonth, iYear)
If iMonth = 12 Then
s = CStr(iYear + 1) & "-01-01"
Else
s = CStr(iYear) & "-" & CStr(iMonth + 1) & "-01"
End If
f = CDate(s)
LastDayInMonth = Day(f - 1)
End Function
' exempel
Response.Write LastDayInMonth(9, 2001)