Calculation and Table

V

Vicki Redding

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?
 
S

Sprinks

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
 
R

Rick B

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
 

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

Top