Age formula and length of time

J

Jessica

I'm current creating a database in which i have the following fields Birth
date, entry Date, clients age and time receiving services. I need a formula
that will automatically calculate the clients age base on the birth date
fiend and the another formula to calculate time receiving services base on
the entry date. How can i do it.
 
B

Beetle

These calculations should not be done at the table level, so you should
not have fields for clients age and time receiveing services in your table.

It is rarely advisable to store calculated values in a table. They should
be done in a calculated field in a query, or in calculated controls on
forms/reports.

An example of an age calculation in a query field would be;

Age: DateDiff("yyyy", [BirthDate], Date) +
(Date < DateSerial(Year(Date), Month([BirthDate]), Day([BirthDate])))

You would then use the query where you would have otherwise used the table.

As far as your time receiving services, you would probably have some
type of termination date field in your table, then you would calculate the
difference between the two dates. Again, this calculation would not be
done in the table.
 

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