How do I add 1 year to a date in a table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I ahve a list of members and the joining dates. I would like to add a Renewal
date column which automaticcally works out the date of renewal from the
joining date. The renewal date should be 1 year after the joining date.

Thank you.
A Stockley
 
Stockers1983 said:
I ahve a list of members and the joining dates. I would like to add a
Renewal date column which automaticcally works out the date of
renewal from the joining date. The renewal date should be 1 year
after the joining date.

Thank you.
A Stockley

No, you don't want data *in your table* that is derived from other data in the
same table. Just build a query based on your table and in the query add a
calculated field...

RenewalDate: DateAdd("yyyy", 1, JoinDate)

....then use this query any place you currently use the table. The field will be
there and will always be correct. Something that would not be true if you saved
this value in your table.
 
If the renewal date will always be one year after the joining date, it
should not be stored in the table. As fellow Access MVP John Vinson likes to
say "Storing calculated data generally accomplishes only three things: it
wastes disk space, it wastes time (a disk fetch is much slower than almost
any reasonable calculation), and it risks data validity, since once it's
stored in a table either the Total or one of the fields that goes into the
total may be changed, making the value WRONG."

Instead, create a query that has Renewal Date as a computed field in it, and
use the query wherever you would otherwise have used the table. To add the
computed field, type the following on the Fields row of an empty column in
the query grid:

RenewalDate: DateAdd("yyyy", 1, [JoinDate])

(replace JoinDate with the actual field name)
 
Back
Top