Future Date - what is the expression I would write

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I have a field entitled "Training Date"
Contains the date of training


Have a field entitled "Next Training Date"
I want to use the date in the "Training Date" field
and add 1 year to get the next year's date in the field
entitled "Next Training Date"

How do I do this?
Been a while since I have used access
thanks,
Lee
 
dtNextTraining=dateadd("y",1,dtLastTraining)

Small mistake -- that will add a day, not a year. Use this:

dtNextTraining=dateadd("yyy",1,dtLastTraining)
 
Use the DateAdd function in an update query, like this:

UPDATE Table
SET Table.Field=DateAdd("yyyy",1,Table.Field)

See the Help topic for DateAdd by switching to SQL view in
your query, and pressing F1 while "DateAdd" is selected.
There are many values you can use as the interval, such as
year, quarter, month, week, day, hour, minute, day of
year, etc.
 

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

Back
Top