Need to calculate elapsed time in years

F

Fred Worthington

Greetings:

My Form contains a "Birthday" Field. I want to include an additional field
that displays the individuals Age by calculating the difference in years
between the birthdate and the current date. So far I have tried this
syntax: =DateDiff("yyyy",[Birthday],[Now()]), but I still get a #Name? in
my Age Field. Can anyone tell me the current formula for this Field?

Thanks . . . Fred
 
R

Rick B

This is posted ALLLLL the time. Did you try doing a search first?


DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))









Rick B
 
R

Rick B

Note that doing it the way you had posted would not take into account if the
person's birthday had passed. If my birthday was May 1, 1974 You would have
seen that I am 30 years old on February of 2004 or on December of 2004.
That's why you can't simply subtract the years.

Rick B



Rick B said:
This is posted ALLLLL the time. Did you try doing a search first?


DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))









Rick B











Fred Worthington said:
Greetings:

My Form contains a "Birthday" Field. I want to include an additional field
that displays the individuals Age by calculating the difference in years
between the birthdate and the current date. So far I have tried this
syntax: =DateDiff("yyyy",[Birthday],[Now()]), but I still get a #Name? in
my Age Field. Can anyone tell me the current formula for this Field?

Thanks . . . Fred
 
F

Fred Worthington

Thanks Rick, that did the trick. Unlike other sources that I tried for this
solution, yours was right on the money.

Thanks . . . Fred


Rick B said:
This is posted ALLLLL the time. Did you try doing a search first?


DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))









Rick B











Fred Worthington said:
Greetings:

My Form contains a "Birthday" Field. I want to include an additional field
that displays the individuals Age by calculating the difference in years
between the birthdate and the current date. So far I have tried this
syntax: =DateDiff("yyyy",[Birthday],[Now()]), but I still get a #Name? in
my Age Field. Can anyone tell me the current formula for this Field?

Thanks . . . Fred
 

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