Age in days

From: "Mark A(dot) Strivens" <strivens(at)bcm(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Age in days
Date: 2005-09-09 16:04:44
Message-ID: 200509091104.45412.strivens@bcm.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ron Mayer 2005-09-09 23:35:30 Re: Indexing an array?
Previous Message Tom Lane 2005-09-09 14:37:00 Re: SELECT: retrieve only 2 rows next to known row