How can I calculate a persons. (1 Viewer)

john527

Registered User.
Local time
Today, 02:25
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
 

BrettStah

Registered User.
Local time
Today, 04:25
Joined
Apr 15, 2007
Messages
49
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.
 

ssteinke

for what it's worth
Local time
Today, 05:25
Joined
Aug 2, 2003
Messages
195
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

Top Bottom