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
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" <raymo...@home.com> wrote in message
news:PvPx4.48635$pN1.4...@news1.rdc1.nj.home.com...