How do I display the last day of a month in an update query?

G

Guest

I want to create an update query that given a specific date in one field,
e.g. 2/14/04, will update another field to the last day of that month, in
this case to 2/29/2004; or if given 5/29/04 will update to 5/31/04, and so
forth. Any ideas out there?

Thanks
 
G

Guest

Thank you so much! have a great weekend!

Rick B said:
DateSerial(Year([SomeDateField]), Month([SomeDateField]), 1)









Jose R said:
I want to create an update query that given a specific date in one field,
e.g. 2/14/04, will update another field to the last day of that month, in
this case to 2/29/2004; or if given 5/29/04 will update to 5/31/04, and so
forth. Any ideas out there?

Thanks
 
F

fredg

I want to create an update query that given a specific date in one field,
e.g. 2/14/04, will update another field to the last day of that month, in
this case to 2/29/2004; or if given 5/29/04 will update to 5/31/04, and so
forth. Any ideas out there?

Thanks

The last day of a given month is day 0 of the following month.

EndMonth:DateSerial(Year([DateField]), Month([DateField])+1, 0)
 
R

Rick B

Fred is right! I pasted the formula for the FIRST day of the month.
SORRY!!!

Rick B


fredg said:
I want to create an update query that given a specific date in one field,
e.g. 2/14/04, will update another field to the last day of that month, in
this case to 2/29/2004; or if given 5/29/04 will update to 5/31/04, and so
forth. Any ideas out there?

Thanks

The last day of a given month is day 0 of the following month.

EndMonth:DateSerial(Year([DateField]), Month([DateField])+1, 0)
 

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