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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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)
 
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)
 
Back
Top