Days in the month

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.
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top