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: Calculate age

Re: Calculate age

From: Bo Bradham <flb3c_at_jm.acs.Virginia.EDU>
Date: Mon, 20 Mar 2006 00:14:23 +0000 (UTC)
Message-ID: <dvks4v$iir$1@murdoch.acc.Virginia.EDU>


Liz J <thejordanschangethistoanatsignclara.net> wrote:
>If I have an entity Student and there is an attribute DOB holding the
>student's date of birth, how can I calculate his age today in years and
>months?
>
>Have been trying this but can't seem to get the syntax right.

Try

        months_between(sysdate,date_of_birth)
That will return age in months as of sysdate.

You can divide the result by 12 for years. If decimal fractions of a year are ok, as opposed to months, that's it. Otherwise you can use mod() to get the months.

Bo Received on Sun Mar 19 2006 - 18:14:23 CST

Original text of this message

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