Calculate age from Birthyear only

antifashionpimp

Registered User.
Local time
Today, 04:02
Joined
Jun 24, 2004
Messages
137
Hi everybody,

I think I’m missing something here, it’s probably very simple, but haven’t found such an example in my trusty reference book or on these newsgroups. :D

I want to calculate the age of a person at the present moment, when you only have the YEAR of birth as info. I know that you can use something like DateDiff(“yyyy”, “10/10/2000”, Now) and this will give you the years since 10/10/2000. But I want my field name BirthYear, which is only a number e.g. 1977 to be used in a function.

Again: how can I calculate the age when I only know the birth year? A difference of one year is OK.

Thanks for your attention!
 
Last edited by a moderator:
Try harder...

The Useful Date Functions sample in the Sample Databases forum (right at the top of the heap) contains the date of birth formula as does the Calculating Age thread in the Code Repository.

There's also an example in the Excel forum and loads in the form and general forum. ;)
 
just use datediff("yyyy","01/01/" & BirthYear, Now)
or maybe 01/06 would be more exact ish:)
 
Thanks guys!

I considered all your replies, and will use this information and spread the word! :p
 
Pat Hartman said:
And then there's
cInt(BirthYear) - Year(Date())

FYI, You should not use Now() in date calculations when you really mean Date().
I would normally, but I thought there was an availability issue with date? ie you can always use Now, but not always Date.
 

Users who are viewing this thread

Back
Top Bottom