Re: Age in days - Mailing list pgsql-sql

From Gnanavel S
Subject Re: Age in days
Date
Msg-id eec3b03c05091222011bae7e3c@mail.gmail.com
Whole thread Raw
In response to Age in days  ("Mark A. Strivens" <strivens@bcm.edu>)
List pgsql-sql
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.

pgsql-sql by date:

Previous
From: tgoodair@ca.afilias.info (Tim Goodaire)
Date:
Subject: Re: Performance issue
Next
From: Michael Glaesemann
Date:
Subject: Re: Age in days