Adding to a date field

  • Thread starter Thread starter Alex H
  • Start date Start date
A

Alex H

Hi i have a field which contains a start date in mm/dd/yy format. I also
have a field which contains the term of the contract in years and expressed
as a number. I want to automatically create an End date field which is the
start date + the length on contact but cant work out the syntax

can anyone help please
thanks

Alex
 
Since the field has the number of years, you can try this:

EndDate = DateAdd("y", NumberOfYears, [StartDateField])

Change the NumberOfYears to your field with Years of contract.
Change the StartDateField to the name of your field

If your want to have a little more flexibility (like forcing the end or
beginning of the month), you can try the function DateSerial.

Take care

Mauricio Silva
 
Thanks Allen

A

Allen Browne said:
Use DateAdd(), e.g.:
DateAdd("yyyy", [TermOfContract], [StartDate])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Alex H said:
Hi i have a field which contains a start date in mm/dd/yy format. I also
have a field which contains the term of the contract in years and
expressed as a number. I want to automatically create an End date field
which is the start date + the length on contact but cant work out the
syntax
 
Back
Top