Received: from cyclades.com.br (root@nicole-kidman.cyclades.com.br [200.246.93.9]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA79783 for ; Thu, 26 Aug 1999 09:25:57 -0400 (EDT) (envelope-from paulok@cyclades.com.br) Received: from cyclades.com.br (danielle-winits.cyclades.com.br [200.246.93.41]) by cyclades.com.br (8.8.8/8.8.3) with ESMTP id KAA02361 for ; Thu, 26 Aug 1999 10:27:45 -0300 Message-ID: <37C53FD3.8410737A@cyclades.com.br> Date: Thu, 26 Aug 1999 10:23:31 -0300 From: Paulo Roberto Kappke Organization: Cyclades Brasil X-Mailer: Mozilla 4.61 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Doubts in timespan Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello all, I'm having some problems with timespan type. I have in the same table an attribute named "inserted_time" with datetime type and another attribute named "elapsed_time" with timespan type. When I'll insert a new entry in this table, I need to calculate the difference between last "inserted_time" and new "inserted_time", and update "elapsed_time" in the last row. I used the following command: "UPDATE tasktime SET elapsed_time='age((SELECT inserted_time FROM tasktime WHERE row=$row),(SELECT inserted_time FROM tasktime WHERE row=$old_row))' WHERE row=$old_row" And I received the message: "PostgresSQL query failed: ERROR: Bad timespan external representation 'age(Thu Aug 26 09:31:00 1999 EST, Thu Aug 26 09:29:00 1999 EST)'" I tried to change the update command as follow: "UPDATE tasktime SET elapsed_time='age($actual_inserted_time, $old_inserted_time)' WHERE row=$old_row" And I received the same message. Any body knows where are my mistake ???? Any body could explain how is the data in a timespan type ???? Thanks in advance, Paulo Roberto Kappke Cyclades Corporation