Age in days

Поиск
Список
Период
Сортировка
Искать

Age in days

От:
"Mark A. Strivens" <strivens@bcm.edu>
Дата:
If you need to know the age to the nearest day on the present day
I think you can use something like:

select date_trunc('day',age(now(),dateofbirth)) from people

gives: 

3 years 2 mons 12 days

My questions is, is there any way to convert that figure into an age
expressed as a number days only?

Many thanks

Mark


Re: Age in days

От:
Gnanavel S <s.gnanavel@gmail.com>
Дата:
This will give you the no of days.
select current_date - dateofbirth::date from people;

On 9/9/05, Mark A. Strivens <strivens@bcm.edu> wrote:
If you need to know the age to the nearest day on the present day
I think you can use something like:

select date_trunc('day',age(now(),dateofbirth)) from people

gives:

3 years 2 mons 12 days

My questions is, is there any way to convert that figure into an age
expressed as a number days only?

Many thanks

Mark


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings



--
with regards,
S.Gnanavel
Satyam Computer Services Ltd.

Re: Age in days

От:
Michael Glaesemann <grzm@myrealbox.com>
Дата:

On Sep 10, 2005, at 1:04 AM, Mark A. Strivens wrote:

> select date_trunc('day',age(now(),dateofbirth)) from people

> My questions is, is there any way to convert that figure into an age
> expressed as a number days only?

Try

select current_date - dateofbirth from people;

Michael Glaesemann
grzm myrealbox com



FAQ