calculate age on specific date

  • Thread starter Thread starter Ezekiël
  • Start date Start date
E

Ezekiël

Hello.

Could anyone explaine how to calculate someone's birthdate or how old
somebody is.

I would like to have a date and the age as a number

Thx
 
DateDiff("yyyy", [BirthDate], Date()) - _
IIf(Format(Date(), "mmdd") < Format([BirthDate], "mmdd"), 1, 0)

To get their age on a specific date, replace the Date function above with
your date.
 
Ezekiël said:
Hello.

Could anyone explaine how to calculate someone's birthdate or how old
somebody is.

I would like to have a date and the age as a number

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This formula has been floating around the newsgroups for a while. Age
would be at Date() [current system date]. It relies on Abs(True) = 1
and False = 0.

year(date) - year(BirthDate) - abs(month(date) < Month(BirthDate))

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQFsQ+oechKqOuFEgEQIB+ACeL96TJTIZQ8BUQuzAWUKdf1QmqFMAoP13
Ub+czTRhHvM2F8+Uqk5aFYDe
=/zaf
-----END PGP SIGNATURE-----
 
Hi Douglas,

Thx for your help, but it does not work for me. For example i want to know
the date when i'm six months old when i was born. Also i want to calculate
backwards like how old i was when i was 12 weeks.

Is this possible?

Ezekiël

Douglas J. Steele said:
DateDiff("yyyy", [BirthDate], Date()) - _
IIf(Format(Date(), "mmdd") < Format([BirthDate], "mmdd"), 1, 0)

To get their age on a specific date, replace the Date function above with
your date.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Ezekiël said:
Hello.

Could anyone explaine how to calculate someone's birthdate or how old
somebody is.

I would like to have a date and the age as a number

Thx
 
For the date 6 months ago, use DateAdd("m", -6, Date())

I don't understand your second question. You'd be 12 weeks old when you're
12 weeks, so I suspect you mistyped what you meant.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Ezekiël said:
Hi Douglas,

Thx for your help, but it does not work for me. For example i want to know
the date when i'm six months old when i was born. Also i want to calculate
backwards like how old i was when i was 12 weeks.

Is this possible?

Ezekiël

Douglas J. Steele said:
DateDiff("yyyy", [BirthDate], Date()) - _
IIf(Format(Date(), "mmdd") < Format([BirthDate], "mmdd"), 1, 0)

To get their age on a specific date, replace the Date function above with
your date.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Ezekiël said:
Hello.

Could anyone explaine how to calculate someone's birthdate or how old
somebody is.

I would like to have a date and the age as a number

Thx
 
Back
Top