http://www.chrispearson.org/pages/programming/vbscript/datework/misc/easydays.asp
09h30
Wednesday, 8. October 2008

EASY DAYS . . .

It happens that using day zero in a date serial works for returning the last day of the previous month (The 0th day of February is the last day of January, that is)

So, with the current month being October, and next month being November, the code

Day(DateSerial(Year(Now), Month(Now)+1, 0)

returns the value 31 , the number of days in October 2008

Back to Days in a month article

xxx,xxx

copyright ©2000 - 2008 Chris Pearson