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 49C81D1B501 for ; Fri, 26 Sep 2003 05:58: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 33675-08 for ; Fri, 26 Sep 2003 02:57:56 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 6A71AD1B52D for ; Fri, 26 Sep 2003 02:57:53 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id D01AA2B3E9; Fri, 26 Sep 2003 07:57:44 +0200 (CEST) Message-ID: <3F73D55E.6030405@klaster.net> Date: Fri, 26 Sep 2003 07:57:50 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5) Gecko/20030916 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Richard Sydney-Smith Cc: pgsql-sql@postgresql.org Subject: Re: Date interval References: <002901c383ed$a70423a0$8f601ad3@athlon2000> In-Reply-To: <002901c383ed$a70423a0$8f601ad3@athlon2000> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/323 X-Sequence-Number: 15301 > I am looking for a way to convert an interval into a number of days ( > integer); > > 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 select extract(epoch from some_interval)/3600/24::integer Regards, Tomasz Myrta