X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 17A62D1B53E for ; Fri, 7 Nov 2003 13:56:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 13241-09 for ; Fri, 7 Nov 2003 09:55:51 -0400 (AST) Received: from tomts5-srv.bellnexxia.net (tomts5.bellnexxia.net [209.226.175.25]) by svr1.postgresql.org (Postfix) with ESMTP id 963DAD1B508 for ; Fri, 7 Nov 2003 09:55:42 -0400 (AST) Received: from [10.0.2.6] ([216.208.117.7]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20031107135545.DAVU21460.tomts5-srv.bellnexxia.net@[10.0.2.6]>; Fri, 7 Nov 2003 08:55:45 -0500 Subject: Re: DateDiff in PostgreSQL From: Rod Taylor To: "George A.J" Cc: pgsql-sql@postgresql.org In-Reply-To: <20031107133409.25844.qmail@web14909.mail.yahoo.com> References: <20031107133409.25844.qmail@web14909.mail.yahoo.com> Content-Type: text/plain Message-Id: <1068213347.42603.2.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 07 Nov 2003 08:55:48 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/42 X-Sequence-Number: 15857 > ie, a function that returns difference of two dates(timestamp) in days > or months or year.. > > The - operator for timestamp retuns the intervel in days only. rbt=# select extract('days' from current_timestamp - '2003-01-01'::timestamp); date_part ----------- 310 (1 row)