X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3E75ED78C6 for ; Tue, 13 Sep 2005 02:01:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44148-02 for ; Tue, 13 Sep 2005 05:01:33 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.200]) by svr1.postgresql.org (Postfix) with ESMTP id 94409D78C3 for ; Tue, 13 Sep 2005 02:01:32 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 40so228150nzk for ; Mon, 12 Sep 2005 22:01:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=udVrbB8iz1AYcmy+plBjAbYU8ueCSoajDYIOev+XhZiiS0alHMPXyWOdjfsBeY1imUGU8YPlWo1dXzkX+AcN7BWCyY0q9FkEIeUBk/6SGB+7HEvtTCvCOpglAaO3d3b+Z55BLYW/YQ+Z9aqamkj58TF0Ns1C+IunusQBL7rHBRo= Received: by 10.36.91.16 with SMTP id o16mr313956nzb; Mon, 12 Sep 2005 22:01:33 -0700 (PDT) Received: by 10.36.119.19 with HTTP; Mon, 12 Sep 2005 22:01:33 -0700 (PDT) Message-ID: Date: Tue, 13 Sep 2005 10:31:33 +0530 From: Gnanavel S Reply-To: s.gnanavel@gmail.com To: strivens@bcm.edu Subject: Re: Age in days Cc: pgsql-sql@postgresql.org In-Reply-To: <200509091104.45412.strivens@bcm.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20692_4490942.1126587693236" References: <200509091104.45412.strivens@bcm.edu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.282 required=5 tests=[AWL=0.201, HTML_30_40=0.056, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200509/140 X-Sequence-Number: 22687 ------=_Part_20692_4490942.1126587693236 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This will give you the no of days. select current_date - dateofbirth::date from people; On 9/9/05, Mark A. Strivens wrote: >=20 > If you need to know the age to the nearest day on the present day > I think you can use something like: >=20 > select date_trunc('day',age(now(),dateofbirth)) from people >=20 > gives: >=20 > 3 years 2 mons 12 days >=20 > My questions is, is there any way to convert that figure into an age > expressed as a number days only? >=20 > Many thanks >=20 > Mark >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >=20 --=20 with regards, S.Gnanavel Satyam Computer Services Ltd. ------=_Part_20692_4490942.1126587693236 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This will give you the no of days.
select current_date - dateofbirth::da= te from people;

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

select date_trunc('day',age(now(),date= ofbirth)) from people

gives:

3 years 2 mons 12 days

My questions is, is there any way to convert that figure into an age
exp= ressed 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
Sat= yam Computer Services Ltd. ------=_Part_20692_4490942.1126587693236--