Convert date to last calendar date

G

Guest

Hi,

How can I convert a given date into the last date of that month? For
example: 5/15/2006 needs to be converted into 5/31/2006. 6/1/2007 needs to
be conveted into 6/30/2007.

Thanks.
 
A

Allen Browne

If the field is named Date1, this expression should give you the last day of
the month:

DateSerial(Year([Date1]), Month([Date1]) + 1, 0)
 
J

Jeff Boyce

Mark

This may seem a bit circuituous, but you can use the DateSerial() function
to find the day BEFORE the first day of NEXT month. The (untested) code
looks something like:

DateSerial(Year([YourDate]), Month([YourDate] + 1,0)

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

That solved my problem,

Thanks.
--
MSS


Allen Browne said:
If the field is named Date1, this expression should give you the last day of
the month:

DateSerial(Year([Date1]), Month([Date1]) + 1, 0)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Mark Senibaldi said:
How can I convert a given date into the last date of that month? For
example: 5/15/2006 needs to be converted into 5/31/2006. 6/1/2007 needs
to
be conveted into 6/30/2007.

Thanks.
 
G

Guest

That solved my problem,

Thanks.
--
MSS


Jeff Boyce said:
Mark

This may seem a bit circuituous, but you can use the DateSerial() function
to find the day BEFORE the first day of NEXT month. The (untested) code
looks something like:

DateSerial(Year([YourDate]), Month([YourDate] + 1,0)

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

Mark Senibaldi said:
Hi,

How can I convert a given date into the last date of that month? For
example: 5/15/2006 needs to be converted into 5/31/2006. 6/1/2007 needs
to
be conveted into 6/30/2007.

Thanks.
 

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