Calc number of days in current month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I calculate the number of days in the current month.

i.e. If the current month is May how do I retrun 31?

Bruce
 
Bruce,

This expression does it:

DateAdd("m",1,Date()-Day(Date())+1)-(Date()-Day(Date())+1)

HTH,
Nikos
 
Nikos Yannacopoulos said:
Bruce,

This expression does it:

DateAdd("m",1,Date()-Day(Date())+1)-(Date()-Day(Date())+1)

HTH,
Nikos

Or alternately:

DateSerial (Year(Date()),(Month(Date())+1),0)

Tom Lake
 
Tom said:
Or alternately:

DateSerial (Year(Date()),(Month(Date())+1),0)

Tom,

This will return the date of the last day in the current month; it
requires the use of Day() on the result to return the count of days in
the month as per the OP.

Regards,
Nikos
 
Tom said:
Tom,

This will return the date of the last day in the current month; it
requires the use of Day() on the result to return the count of days in the
month as per the OP.

Yup, so it does:

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

Tom Lake
 
Back
Top