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 835C0D1B3CA for ; Fri, 28 May 2004 18:18:30 -0300 (ADT) 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 41236-06 for ; Fri, 28 May 2004 18:18:30 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 85144D1B34D for ; Fri, 28 May 2004 18:18:28 -0300 (ADT) Received: (qmail 1924 invoked by uid 500); 28 May 2004 21:23:54 -0000 Date: Fri, 28 May 2004 16:23:54 -0500 From: Bruno Wolff III To: Pablo Velasquez Rivas Cc: pgsql-sql@postgresql.org Subject: Re: About intervals Message-ID: <20040528212354.GB1689@wolff.to> Mail-Followup-To: Pablo Velasquez Rivas , pgsql-sql@postgresql.org References: <40B784A9.70306@its.co.cr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40B784A9.70306@its.co.cr> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/220 X-Sequence-Number: 17934 On Fri, May 28, 2004 at 12:27:53 -0600, Pablo Velasquez Rivas wrote: > > but if I do a query like this, I get: > / SELECT date2 - date1 as diff FROM table WHERE date2 - date1 >= > interval '15:00';/ > * diff > ------ > (0 rows) > * > What can I do to do a query like the previous one , and get the right > answer?? It looks like 15:00 is being taking to mean 15 hours 0 minutes. The more normal syntax for specifying 15 minutes is '15 minutes. So you probably want: SELECT date2 - date1 as diff FROM table WHERE date2 - date1 >= interval '15 minutes';