Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3EDE41337B8A for ; Mon, 31 Jan 2011 12:45:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 31492-04 for ; Mon, 31 Jan 2011 16:45:07 +0000 (UTC) X-Greylist: delayed 00:05:37.603323 by SQLgrey-1.7.6 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mail.postgresql.org (Postfix) with ESMTP id E7B7E1337B84 for ; Mon, 31 Jan 2011 12:45:06 -0400 (AST) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 3A7BD28F74E; Mon, 31 Jan 2011 10:39:28 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh3.mail.rice.edu, auth channel Received: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iwL-ZxsmVUlZ; Mon, 31 Jan 2011 10:39:28 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.is.rice.edu (aart.is.rice.edu [168.7.56.48]) by mh3.mail.rice.edu (Postfix) with ESMTP id D9C4228F6F5; Mon, 31 Jan 2011 10:39:27 -0600 (CST) Received: by aart.is.rice.edu (Postfix, from userid 18612) id B77D72D5A6; Mon, 31 Jan 2011 10:39:27 -0600 (CST) Date: Mon, 31 Jan 2011 10:39:27 -0600 From: Kenneth Marshall To: Emi Lu Cc: pgsql-sql@postgresql.org Subject: Re: Get days between two dates? Message-ID: <20110131163927.GF24931@aart.is.rice.edu> References: <4D46DA53.9050402@encs.concordia.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D46DA53.9050402@encs.concordia.ca> User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/126 X-Sequence-Number: 35073 On Mon, Jan 31, 2011 at 10:50:43AM -0500, Emi Lu wrote: > Good morning, > > Is there an existing method to get days between two dates? > > For example, > > select '2010-01-01'::date - '1999-10-12'::date > > Returns how many days. > > Thank you, > > -- > Lu Ying > Didn't you just answer your own question? Cheers, Ken