Need to calculate elapsed time in years

  • Thread starter Thread starter Fred Worthington
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top