dates of birth and ages fields

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

Guest

I have a database whith family records on, when our date of births are put in
the ages are automatically added and changes as the the year changes. when a
quary is done some of the ages are not showing or arew wrong, this also is
happening when I view the form in the tables view.
 
I have a database whith family records on, when our date of births are put in
the ages are automatically added and changes as the the year changes. when a
quary is done some of the ages are not showing or arew wrong, this also is
happening when I view the form in the tables view.

1) All you should save in your table is the date of birth, not the
age. Any age saved in your table is going to be wrong within a year.

2) When you need that person's age, calculate it, in a query, form, or
report.

3) Here is an expression you can use to accurately calculate a persons
age. It takes into effect whether or not that month and day has
already passed.

Age:In a query:
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)

Directly as the control source of an unbound control:
=DateDiff("yyyy",[DOB],Date())-IIf(Format([DOB],"mmdd")>Format(Date(),
"mmdd"),1,0)
 

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

Similar Threads

Age 9
Age formula and length of time 1
Age 4
Age at Case closure 6
Query: calc. age based on birth date 1
Handling of null return in number field on form? 4
Calculating a person's age 2
Date of Birth 4

Back
Top