Days in month

IanT

Registered User.
Local time
Today, 13:29
Joined
Nov 30, 2001
Messages
191
I have a field containing a date ie 25/05/2005. How can I calculate the number of days in the month ie March 2005 = 31 days!
 
intDays = DateSerial(Year(dDate), Month(dDate) + 1, 1) - DateSerial(Year(dDate), Month(dDate), 1)

where dDate is your Date

HTH

Peter
 
Day(DateSerial(Year(YourDate), Month(YourDate) + 1, 0))

Day '0' in DateSerial() gives you the last day of the previous month.
 

Users who are viewing this thread

Back
Top Bottom