Calculation and Table

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

Guest

I have age and DOB In my personnel table. To calculate the age, I have used
this expression:
=datediff("yyyy",[DOB],Now())+Int(format(Now(),"mmdd")<Format([DOB],"mmdd"))
The age appears in my query, form, and report; however, it does not appear
in my table. Why and how do I get it to appear in my table?
 
Vicki,

You needn't and shouldn't store a calculation in a table. Since you have
stored the birthdate, simply recalculate the age in a query or form
expression whenever you need it. If you store the age today, a year from now
or less the age will be wrong.

Since you should NEVER allow users to interact with your tables directly,
this isn't a limitation. Simply use an unbound control set to your
expression in the forms the users interact with.

Hope this helps.
Sprinks
 
You don't. You don't store calculated values in your table; the values
change each year. Also, that would be redundant. That would be similar to
having a firstname field, a lastnamefield, a firstandlastname field and a
lastandfirstname field. Just taking up space and slowing down your
database.

When you need to pull the age, use your calculation.



Rick B
 
Back
Top