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 BFF27D1B4FF for ; Fri, 26 Sep 2003 06:13:32 +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 38022-04 for ; Fri, 26 Sep 2003 03:13:02 -0300 (ADT) Received: from rock.spider.ru (rock.spider.ru [62.183.34.226]) by svr1.postgresql.org (Postfix) with ESMTP id 74995D1B50A for ; Fri, 26 Sep 2003 03:13:00 -0300 (ADT) Received: from rock (localhost [127.0.0.1]) by rock (Postfix) with SMTP id 9BB889122F for ; Fri, 26 Sep 2003 10:12:59 +0400 (MSD) Received: from sad.localnet.ru (sad.localnet.ru [10.0.0.33]) by rock.spider.ru (Postfix) with ESMTP id 58A819121D for ; Fri, 26 Sep 2003 10:12:59 +0400 (MSD) Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: Subject: Re: Date interval Date: Fri, 26 Sep 2003 10:16:10 +0400 User-Agent: KMail/1.4.3 References: <002901c383ed$a70423a0$8f601ad3@athlon2000> In-Reply-To: <002901c383ed$a70423a0$8f601ad3@athlon2000> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200309261016.10724.sad@bankir.ru> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/324 X-Sequence-Number: 15302 On Friday 26 September 2003 09:18, you wrote: > 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) SELECT now()::DATE - '1900-12-10'::DATE; ?column?=20=20=20=20=20=20=20=20=20=20=20=20 -------------------------------- 37545 SELECT now()-'1900-12-10'::timestamp; ?column?=20=20=20=20=20=20=20=20=20=20=20=20 -------------------------------- 37545 days 06:10:54.2021608353