Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add/Subtract one month to a date field

Status
Not open for further replies.

Gregro

Vendor
Jul 6, 2003
3
ZA
Hello there

This is probably very simple, but has stumped me for the last few days. I want to run a query to change the date in a table by one month, ie 2003/07/31 should change to 2003/06/30, & conversely 2002/12/31 should change to 2003/01/31.

Also at the same time I want to force any date in the system to the last day of the month.

Any assistance would be appreciated.

Regards
 
Use the DateAdd function:

DateAdd("m", 1, [DateField]) 'This will add a month

DateAdd("m", -1, [DateField]) 'This will subtract a month

Post back with any questions.


Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top