X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F40E55651B for ; Mon, 28 Feb 2005 19:33:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18737-01 for ; Mon, 28 Feb 2005 19:33:05 +0000 (GMT) Received: from vms040pub.verizon.net (vms040pub.verizon.net [206.46.252.40]) by svr1.postgresql.org (Postfix) with ESMTP id 4BA7E5514D for ; Mon, 28 Feb 2005 19:33:01 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0ICM00148ZN1M841@vms040.mailsrvcs.net> for pgsql-sql@postgresql.org; Mon, 28 Feb 2005 13:33:02 -0600 (CST) Date: Mon, 28 Feb 2005 14:37:05 -0500 From: "Joel Fradkin" Subject: Re: diference in dates in minutes In-reply-to: <20050228152441.GA16739@wolff.to> To: "'Bruno Wolff III'" Cc: Message-id: <001301c51dcc$e38f4b40$797ba8c0@jfradkin> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.146 tagged_above=0 required=5 tests=AWL, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200502/366 X-Sequence-Number: 20476 Sorry you are correct again it is TimeStamp not date. So maybe that is why it appeared to work ok. I will do as you suggest and play around with it before I accept it is a perfect solution, but it appeared to do what I was looking for (figure = the difference in minutes). Joel Fradkin =20 Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 =20 jfradkin@wazagua.com www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized = review, use, disclosure or distribution is prohibited. If you are not the = intended recipient, please contact the sender by reply email and delete and = destroy all copies of the original message, including attachments. =20 =20 -----Original Message----- From: pgsql-sql-owner@postgresql.org = [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Bruno Wolff III Sent: Monday, February 28, 2005 10:25 AM To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] diference in dates in minutes On Mon, Feb 28, 2005 at 09:09:09 -0500, Joel Fradkin wrote: > Yea I probably forgot respond to all. I agree (specialy for this = topic). >=20 > In any case, I have dates not time (dates with times). It really helps if you use precise language when discussing problems. date, time with time zone, time without time zone, timestamp with time = zone, and timestamp without time zone are all different types. > I did not use datevar::date - date2::date, I did datevar - datevar2 = and it > appeared to work. That can not give you a result that is an interval if datevar and = datevar2 are actually dates. They must be some other type, probably a timestamp of some sort. > Since the dates I was comparing were over a year apart the number in = secs > was hard to verify. Soon as I get to debuggin the actual app where the time > dif will be a few minutes I will let you know if it worked to do the=20 > date_part('epoch',date-date) returns in secs so /60. If the date variables are of type timestamp with time zone you should be OK. You probably want to test comparing dates in different time zones (if you have different time offsets from GMT at different times of the = year at your locale, e.g. daylight savings vs standard time) to make sure you = get the expected result. ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings