Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A0CF047592C for ; Sun, 27 Oct 2002 14:47:31 -0500 (EST) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id F415D4753A1 for ; Sun, 27 Oct 2002 14:47:30 -0500 (EST) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1801028; Sun, 27 Oct 2002 11:49:16 -0800 From: "Josh Berkus" Subject: Re: datediff? To: Erwin Moller Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Sun, 27 Oct 2002 11:49:16 -0800 Message-ID: In-Reply-To: <3.0.6.32.20021027200612.00866960@pop.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/366 X-Sequence-Number: 10083 Erwin, > Thanks for your quick response Josh. > > I wasn't aware of the Postgresql-function DATEDIFF() > The accolade ' is not a problem of course! Whoops! Didn't want to confuse you. What I meant was, a PgSQL function "Datediff" could be easily *written*, except that it would need quoted identifiers, different from the T-SQL function. If anyone on this list has written a DateDiff, please post! > But I have to say to my shame, I was asking you too soon, because all > I > really needed was a function that could return me some absolute > timediff, > and I found date_part('epoch', date) does the trick nicely enough for > me. > I can now take the diff in millisecs since start of epoch, which is > enough > to do all other calculations easily. Cool! Glad that you found something that would work for you. -Josh