Re: Baby question about counting AGE!

From: Brian W. Chester <bwchester_at_home.com>
Date: 2000/03/09
Message-ID: <pZPx4.14989$a27.249029_at_news1.rdc1.mb.home.com>#1/1


Ray,

If BIRTHDATE is stored as an Oracle date field then simply

SELECT sysdate - birthdate FROM some_table

   WHERE person_field = 'some_person';

If BIRTHDATE is stored as char, or varchar:

SELECT sysdate - TO_DATE(birthdate, 'DD-MON-YY')   FROM some_table
  WHERE somecondition;

Of course this introduces some Y2K issues with the YY but you get the drift!

HTH Brian

"Ray" <raymondsee_at_home.com> wrote in message news:PvPx4.48635$pN1.461370_at_news1.rdc1.nj.home.com...
> Sorry people,
>
> I am new to SQL, so, can anyone show me the command used/the way to count
> the AGE of a person given only their BIRTHDATE (eg: 19-JUL-58) ? I know
 we
> can use the present date to minus the birthdate, but how?
>
> Thanks
>
> RAY
>
>
>
>
>
>
Received on Thu Mar 09 2000 - 00:00:00 CET

Original text of this message