Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Question:Age From Birthdate

Re: SQL Question:Age From Birthdate

From: TurkBear <johng_at_mm.com>
Date: Tue, 26 May 1998 21:13:30 GMT
Message-ID: <356b2f88.25410908@news2.mm.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US