Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Question:Age From Birthdate
Assuming that the birthdate is an Oracle date format field, this will
do it:
select (sysdate-birthdate)/365.25 age from table;
The sysdate-birthdate gives the number of days between the 2 dates -
dividing by 365.25 gives years ( you can round or trunc it as well :
select round((sysdate-birthdate)/365.25) ageround from table or
select triunc((sysdate-birthdate).365.25) agetrunc from table)
Good luck,
John Greco
Michael Wallach <michaelw_at_totalsports.net> wrote:
>Does anyone know how using SQL I can determine someone's age based on
>their birthdate?
>
>Mike
>
Received on Tue May 26 1998 - 16:13:30 CDT