pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gnanavel S <s.gnanavel@gmail.com>
To: strivens@bcm.edu
Cc: pgsql-sql@postgresql.org
Subject: Re: Age in days
Date: Tue, 13 Sep 2005 10:31:33 +0530
Message-ID: <eec3b03c05091222011bae7e3c@mail.gmail.com> (raw)
In-Reply-To: <200509091104.45412.strivens@bcm.edu>
References: <200509091104.45412.strivens@bcm.edu>

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.

view thread (3+ messages)  latest in thread

Message-ID: <eec3b03c05091222011bae7e3c@mail.gmail.com>
Permalink:  ../eec3b03c05091222011bae7e3c@mail.gmail.com/
Also on:    postgresql.org/message-id/eec3b03c05091222011bae7e3c@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: s.gnanavel@gmail.com, strivens@bcm.edu
  Subject: Re: Age in days
  In-Reply-To: <eec3b03c05091222011bae7e3c@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox