How can I calculate a persons.

john527

Registered User.
Local time
Today, 01:03
Joined
Jul 9, 2006
Messages
36
I have a field name cust_birthday
Data Type Date/Time
Input Mask 99/99/0000;0;_

I have a field name cust_age
Date Type number

What I can not do is to have cust_age calculate the persons age based on the cust_birthday.
Can someone help me please.

Thank you for all the help.

John .C
 
First, why do you have a field for age? Since that information is a calculation (current date minus birth date), you probably shouldn't be storing it. Rather, just calculate it whenever you need it.

Here's a way of calculating it (this next line could be put into an unbound textbox on a form):

=Int((Now()-[BirthDate])/365.2425)

You'd put this next line into an empty column in a query in design mode, next to your "real" fields:

CustomerAge: Int((Now()-[BirthDate])/365.2425)

Just make sure that you check the checkbox in that column on the "Show" row so that it appears when you run the query.
 
A search of the forum will give you dozens of examples. I would recommend you consider searching for the answer before posting.

Also, you posted this same question six months ago... did you follow the advise in that post?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom