add date automatically

PARSO

Registered User.
Local time
Today, 10:34
Joined
Dec 13, 2004
Messages
66
i want to add a date that is 30 months after the original date

field 1 field 2
expiry date renewal date

can somebody help me with code to take the date from field 1 and add 30 months to it and place the new date in field 2??

thanxs in advance
 
sonny said:
=DateAdd("m",+30,[StartDate])

You don't need the + for positive numbers.

And, to PARSO, if you have this second field in a table - DELETE IT, as it is unnecessary; you should use a query to get this value.
 
Thanks to both, but where exactly do i put the code? as i was intending on using it in a query... but now it seams it may be best as a validation rule or somthing??

SJ could you explain a lil about how to use the query?
the fields i have are ID, name, course, date issued, renewal date

i want the renewal date 30 months after the date issued. and for a query to produce a list of records when the date issed is at least 30 month expired.
maybe you know an easier way i could achive this?

thanxs
 
Last edited:
ok ive figuered that out now. i used an update query and VB to update automatically.

but i now need some code that will select all records where the curent date is equal too or greater than the alert date.


Date()=>[Alertdate]

somthing along this line???
 
Hi,

as has been mentioned, you don't need this field in your table at all, also mentioned, delete it.

Use:

DateAdd("m",30,[StartDate]) > Date() <--- whatever date you are testing agianst.

As the Criteria in a query.
 

Users who are viewing this thread

Back
Top Bottom