X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5C408D1B544 for ; Fri, 26 Sep 2003 05:16:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 26848-04 for ; Fri, 26 Sep 2003 02:15:56 -0300 (ADT) Received: from server146.hostingrevolution.com (unknown [64.21.143.245]) by svr1.postgresql.org (Postfix) with ESMTP id DA130D1B4E8 for ; Fri, 26 Sep 2003 02:15:54 -0300 (ADT) Received: from 143.a.004.pth.iprimus.net.au ([211.26.96.143] helo=athlon2000) by server146.hostingrevolution.com with smtp (Exim 4.23) id 1A2kxv-0003LL-4t for pgsql-sql@postgresql.org; Fri, 26 Sep 2003 00:16:06 -0500 Message-ID: <002901c383ed$a70423a0$8f601ad3@athlon2000> From: "Richard Sydney-Smith" To: Subject: Date interval Date: Fri, 26 Sep 2003 13:18:27 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C38430.ABDBEF00" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server146.hostingrevolution.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - ibisaustralia.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_50_60 X-Spam-Level: X-Archive-Number: 200309/322 X-Sequence-Number: 15300 This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C38430.ABDBEF00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am looking for a way to convert an interval into a number of days ( integ= er); In sybase I would use : days(today()-r_expire) where r_expire is the timestamp I am comparing against. How do we do this in postgres? date_trunc(today()-r_expire) does not seem to do it thanks=20 Richard ------=_NextPart_000_0020_01C38430.ABDBEF00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am looking for a way to convert an inter= val into=20 a number of days ( integer);
 
In sybase I would use :
 
days(today()-r_expire)
 
where r_expire is the timestamp I am compa= ring=20 against.
 
How do we do this in postgres?
 
date_trunc(today()-r_expire) does not seem= to do=20 it
 
thanks
 
Richard
 
------=_NextPart_000_0020_01C38430.ABDBEF00--