Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 22346475D93 for ; Thu, 16 Jan 2003 04:36:44 -0500 (EST) Received: from lucidindia.net (unknown [61.11.73.194]) by postgresql.org (Postfix) with ESMTP id 3CD6F475B8C for ; Thu, 16 Jan 2003 04:36:40 -0500 (EST) Received: from a4005 ([192.168.1.18]) by lucidindia.net (8.11.6/8.11.6) with SMTP id h0G9aYE30303 for ; Thu, 16 Jan 2003 09:36:34 GMT Message-ID: <00a201c2bd42$c10b4e30$1201a8c0@a4005> From: "shreedhar" To: "Postgres" Subject: Is There any function to get Difference of Dates Date: Thu, 16 Jan 2003 15:06:32 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/165 X-Sequence-Number: 7007 Hi All, Is There any function to get Difference of Dates. Here tdate is of type timestamp If I tried select * from temptbldate WHERE (EXTRACT(EPOCH FROM TIMESTAMP 'now()') - EXTRACT(EPOCH FROM TIMESTAMP tdate) )/ 86400 < 2 I got error as 'Parse error at tdate' select * from temptbldate WHERE (EXTRACT(EPOCH FROM TIMESTAMP 'now()') - EXTRACT(EPOCH FROM TIMESTAMP 'tdate') )/ 86400 < 2 If I use 'tdate', I got 'bad timestamp external representation 'tdate', Probably it might be taking 'tdate' as string. How can I use epoch to get difference of two dates. Regards, Sreedhar "Faith, faith, faith in ourselves, faith, faith in God, this is the secret of greatness. If you have faith in all the three hundred and thirty millions of your mythological gods, and in all the gods which foreigners have now and again introduced into your midst, and still have no faith in yourselves, there is no salvation for you. " (III. 190)