Re: SQL*Plus-age

From: Richard Booker <rbooker_at_21stcentury.net>
Date: Mon, 14 Oct 2002 06:14:20 -0500
Message-ID: <3DAAA70C.6030907_at_21stcentury.net>


If you only need the age as of say the first of the month, then you can use MONTHS_BETWEEN() the birth date and the system date to get the (age in months).

The (age in years) would be the result divided by 12 truncated to an integer.

The months to tack on would be the (age in months) - (age in years * 12) .

Alan Mills wrote:
Not directly.  However, when you bear in mind that dates are really just
floating point numbers (i.e the number of days since some designated year
dot - does anyone know the reference date?) then you can simply subtract one
date from another to get hte number of days between. Divide the result by
365 (adjust for leap years maybe) and you have your age.

"Bo" <esobolew_at_hotmail.com> wrote in message
news:186229a7.0210140103.3b0189ad@posting.google.com...
Hi all !
I`m using SQL*plus to write querys. Is there any command to deliver
age from date of birth ?
Thanks for any help
Bo



Received on Mon Oct 14 2002 - 13:14:20 CEST

Original text of this message