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 67367D1E178 for ; Fri, 28 May 2004 17:39:46 -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 16497-01 for ; Fri, 28 May 2004 17:39:41 -0300 (ADT) Received: from antispam.its.co.cr (unknown [196.40.39.82]) by svr1.postgresql.org (Postfix) with ESMTP id 44678D1E001 for ; Fri, 28 May 2004 15:29:24 -0300 (ADT) Received: from localhost.localdomain (unknown [192.168.226.10]) by antispam.its.co.cr (Postfix) with ESMTP id 65EA32D61 for ; Fri, 28 May 2004 12:29:26 -0600 (CST) Received: from its.co.cr (hades.its.co.cr [196.40.31.147]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id i4SIX2s13283 for ; Fri, 28 May 2004 12:33:02 -0600 Message-ID: <40B784A9.70306@its.co.cr> Date: Fri, 28 May 2004 12:27:53 -0600 From: Pablo Velasquez Rivas User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: About intervals Content-Type: multipart/alternative; boundary="------------090101020403020301080207" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.4 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: * X-Archive-Number: 200405/219 X-Sequence-Number: 17933 This is a multi-part message in MIME format. --------------090101020403020301080207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi all. I have a table with some timestamps fields. For example this table: * date1 | date2 -----------------------------+--------------------------- 2004-03-01 11:20:00 | 2004-03-01 11:55:00* If I do a query like this, I get: / SELECT date2 - date1 as diff FROM table/; * diff ------- 00:35 (1 row) * 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?? Thanks !! -- == == Pablo A. Velasquez Rivas Computer Science Engineer == == / All programmers are optimists / -- Frederick P. Brooks, Jr. --------------090101020403020301080207 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all.
I have a table with some timestamps fields. For example this table:

              date1        |         date2       
-----------------------------+---------------------------
 2004-03-01 11:20:00 | 2004-03-01 11:55:00


If I do a query like this, I get:

 SELECT date2 - date1 as diff FROM table;
 diff 
-------
 00:35
(1 row)


 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??

Thanks !!
--
Firma ==                                 ==
   Pablo A. Velasquez Rivas
Computer Science Engineer
==                                 ==
All programmers are optimists -- Frederick P. Brooks, Jr.
--------------090101020403020301080207--