Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7GKg9P30407 for ; Thu, 16 Aug 2001 16:42:09 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 103582; Thu, 16 Aug 2001 13:42:06 -0700 From: "Josh Berkus" Subject: Re: Interval FAQ - please review To: "Jeff Eckermann" , "Josh Berkus" , X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Thu, 16 Aug 2001 13:42:06 -0700 Message-ID: In-Reply-To: <029801c12688$b9047790$279c10ac@INTERNAL> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200108/221 X-Sequence-Number: 4453 Jeff, > Why not just include examples of DATEDIFF and DATEADD functions? > For example: > CREATE FUNCTION datediff(timestamp, timestamp) > RETURNS integer AS ' > BEGIN > RETURN $2 - $1; > END; > ' LANGUAGE 'plpgsql'; Not a bad idea. Unfortunately, DATEDIFF & DATEADD are more complicated than that. More importantly, I don't want to get into Function design in this article, which is aimed at newbies. If, however, anyone *does* have an online sample of one or both of these two functions, I'd love to link to it from the article. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco