Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by hub.org (8.10.1/8.10.1) with ESMTP id e9CFZer83759 for ; Thu, 12 Oct 2000 11:35:40 -0400 (EDT) Received: from [206.169.43.130] (HELO agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.3) with ESMTP id 1098997 for pgsql-sql@postgresql.org; Thu, 12 Oct 2000 08:35:39 -0700 Message-ID: <39E5DA4B.DCE967D6@agliodbs.com> Date: Thu, 12 Oct 2000 08:35:39 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions X-Mailer: Mozilla 4.73 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: sqllist Subject: Re: if else query help References: <5.0.0.25.2.20001012094914.081abeb0@pop.mindspring.com> <6812102772.20001012165653@thefreecat.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/116 X-Sequence-Number: 1778 Brian, Jean-Christophe, >Someone corrects me if I'm wrong, I come from the Oracle world... > > Dates (or I should say TimeStamps) are stored as floating point values > : the integer part is the number of days since a certain date > (epoch or 01/01/1970 on unix-based databases) and the fractionnal part is the > portion of the day (although I don't know --yet-- how to convert > date2-date1 to an integer, trunc does not work). You're doing this the hard way. One of Postgres' best features is its rich collection of date-manipulation functions. Please see: ... Hmmmm. The online docs appear to be down. When they're back up, please check the sections on: Date/Time data types, and Date/Time manipulation functions. -Josh Berkus P.S. Brian, a general tutorial on writing SQL, such as O'Reilly's soon-to-be released SQL book, might help you a great deal. -- ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 436-9166 for law firms, small businesses fax 436-0137 and non-profit organizations. pager 338-4078 San Francisco