Use Control Source to calculate age

wally

Registered User.
Local time
Yesterday, 18:04
Joined
Apr 15, 2012
Messages
11
I already have a date of birth field named DOB. I am trying to calculate age with full years, months, and days using the control source in a text box, but all I can get in return is the calculated years old and nothing else. Here is my code:

Code:
=DateDiff("yyyy",[DOB],Date())+Int(Format(Date(),"mmdd")<Format([DOB],"mmdd"))

What am I forgetting?

Thanks in advance!
 
Tried this and it doesn't seem to work either...

Code:
=DateDif([DOB],TODAY(),"y") & " years " & DateDif([DOB],TODAY(),"ym") & " months " & DateDif([DOB],TODAY(),"md") & " days"
 
Found this one too:

Code:
=DateDiff("yyyy",[DOB],Now())

Any way to add days and months to that?
 
Datediff is not reliably when calculating age, so I've made an example... Feel free to use it!~)
 

Attachments

Users who are viewing this thread

Back
Top Bottom