Days in the month

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Anyone know a quick snip of code to get the number of
days in a month. I have a date(04/01/04) and need to
know how many days in April.

Thanks so much.
 
Use DateSerial. Add 1 to the month and use 0 for the date.

Example:
The last day of the current month will be
DateSerial(Year(Date()), Month(Date()) + 1, 0)

The 0 is actually 1-1, subtract 1 from the first day of the next month.
 
Back
Top