Last date in a given month

M

Marek

Hi

Does anyone have any ideas on how I can determine the last date in a month, i.e. if it's February then 28 (29 if leap year), if it's March, then 31 etc

I am sure there must be a function that can do this

many thank
Marek
 
B

Brian Camire

You might use the DateSerial function an expression like this:

DateSerial([Given Year], [Given Month Number] + 1, 0)

To find the last date in the current month, you might use the following
expression:

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

Marek said:
Hi,

Does anyone have any ideas on how I can determine the last date in a
month, i.e. if it's February then 28 (29 if leap year), if it's March, then
31 etc.
 
C

Cheryl Fischer

The following will give you the last day of the current year and month:

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

You can edit the function to supply a specific year and month number.

hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Marek said:
Hi,

Does anyone have any ideas on how I can determine the last date in a
month, i.e. if it's February then 28 (29 if leap year), if it's March, then
31 etc.
 

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