age rounding up or down

  • Thread starter Thread starter Abe
  • Start date Start date
A

Abe

I'm using this formula from the office help to calculate a birthdate:
=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format(
[Birthdate], "mmdd") )

My fields have the same name, but my query is outputting the wrong age -
rounding up or down. How can I make it exact?
 
CalcAge = DateDiff("yyyy", BirthDate, DateToday) _
- IIf(Format(DateToday, "mmdd") < Format(BirthDate, "mmdd"), 1, 0)
 
I'm using this formula from the office help to calculate a birthdate:
=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format(
[Birthdate], "mmdd") )

My fields have the same name, but my query is outputting the wrong age -
rounding up or down. How can I make it exact?

The expression returns the age in years as an integer. I turned 63 on May 16,
and I'll be 63 until May 16 next year. That's the purpose of the expression!

What do you have in Birthdate? What is it that you're trying to calculate (you
say "to calculate a birthdate" but the expression assumes you HAVE a
birthdate).

Please explain what you have and what you want.
 
Sorry I wasn't clear. I'm trying to get the age, but that formula didn't
return the exact age, it made the person younger or older depending on the
proximity of the current month. I got the answer in the next post though!
--
Thanks anyway, Abe


John W. Vinson said:
I'm using this formula from the office help to calculate a birthdate:
=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format(
[Birthdate], "mmdd") )

My fields have the same name, but my query is outputting the wrong age -
rounding up or down. How can I make it exact?

The expression returns the age in years as an integer. I turned 63 on May 16,
and I'll be 63 until May 16 next year. That's the purpose of the expression!

What do you have in Birthdate? What is it that you're trying to calculate (you
say "to calculate a birthdate" but the expression assumes you HAVE a
birthdate).

Please explain what you have and what you want.
 
Back
Top