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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding by years 1

Status
Not open for further replies.

wx5chr

Technical User
Jan 21, 2004
31
US
This should be an easy question, but I can't remember how to do it for the life of me.

I have a field [Rev_Pub_Date] which is formatted as a date. I want another field [Next_Rev_Date] to be automatically set two years later.

Right now I have Next_Rev_Date = Rev_Pub_Date + 730, but this doesn't set it to the exact date plus two years. It's usually a day or two prior.
 
Use:

DateAdd("yyyy",2,[Rev_Pub_Date])

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
In your query use -

NextDate: DateAdd("yyyy",2,[YourDateField])

That will add two years to whatever year your date field holds.


HTH,

Steve
 
Thanks much. I knew it was something easy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top