Last date in a given month

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

Guest

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
 
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.
 
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.
 
Back
Top