Age

H

HRMan

How can I take the Birth dates in my Date of Birth field to come up with an
Age in the Age field, and can that auto populate?
 
R

Rick B

Use...

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











Note: This is a very common question. You should try searching for
previous posts before posting a new thread in a newsgroup. That is the
reason that previous posts are saved.



Rick B
 
H

HRMan

Can this be done in the Table Design View?

Rick B said:
Use...

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











Note: This is a very common question. You should try searching for
previous posts before posting a new thread in a newsgroup. That is the
reason that previous posts are saved.



Rick B



Madhivanan said:
SELECT round( DATEDIFF('d','16/5/2002',date())/365,2)

Madhivanan
 
R

Rick B

No, you do it in a query, form. or report. Age is a point in time.
Storing it would make no sense. What happens when the person ages?

Rick B


HRMan said:
Can this be done in the Table Design View?

Rick B said:
Use...

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











Note: This is a very common question. You should try searching for
previous posts before posting a new thread in a newsgroup. That is the
reason that previous posts are saved.



Rick B



Madhivanan said:
SELECT round( DATEDIFF('d','16/5/2002',date())/365,2)

Madhivanan
 
H

HRMan

I have set a parameter in my database that prevents
anyone from aging, so in the case I could "hard" code
their age, as they will never get any older.

Thanks for the tip
-----Original Message-----
No, you do it in a query, form. or report. Age is a point in time.
Storing it would make no sense. What happens when the person ages?

Rick B


news:CB5E1FD2-B42B-4C3D-96A7-
[email protected]...
Can this be done in the Table Design View?

Rick B said:
DateDiff("yyyy",[Birthdate],Date())+(Format
([Birthdate],"mmdd")>Format(Date( ...

.
 
D

Derek

We were using the same formulas referred to in these forums and were getting
odd results, like negative age values and/or ?#NAME errors, so we came up
with this code: =(38108-[DOB])/365 where 38108 is the date value for
05/01/2004 as a constant date (you can get the date value for any year in
Excel by formatting the cell to general number). Since we needed to know a
person's age as of a specific date.

Just trying to be helfpul.
 
D

Dirk Goldgar

Derek said:
We were using the same formulas referred to in these forums and were
getting odd results, like negative age values and/or ?#NAME errors,
so we came up with this code: =(38108-[DOB])/365 where 38108 is the
date value for 05/01/2004 as a constant date (you can get the date
value for any year in Excel by formatting the cell to general
number). Since we needed to know a person's age as of a specific
date.

Just trying to be helfpul.

Helpfulness is always appreciated, but I feel compelled to point out
that, while it may possibly work for your specific application and in
the cases you've encountered so far, the formula you posted is most
definitely not accurate -- it's even less accurate than the (inaccurate)
division by 365.25.

Several different methods for coming up with an accurate age have been
posted many times in these newsgroups, including the one posted by
RickB. If you were getting negative age values from one of these
functions, you probably fed the dates to the formula in the wrong order.
If you got #NAME errors, you probably made some other trivial mistake.
If you want to give more details, we can try to fix you up.
 
Top