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 7A7143A5750 for ; Tue, 25 Jan 2005 17:51:26 +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 95094-03 for ; Tue, 25 Jan 2005 17:51:23 +0000 (GMT) Received: from out014.verizon.net (out014pub.verizon.net [206.46.170.46]) by svr1.postgresql.org (Postfix) with ESMTP id 54E1B3A4AFF for ; Tue, 25 Jan 2005 17:51:20 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by out014.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050125175119.WZYT28388.out014.verizon.net@jfradkin>; Tue, 25 Jan 2005 11:51:19 -0600 From: "Joel Fradkin" To: "'Achilleus Mantzios'" Cc: Subject: Re: datediff is there something like it? Date: Tue, 25 Jan 2005 12:54:25 -0500 Message-ID: <000201c50306$e9c1b380$797ba8c0@jfradkin> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-7" Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Authentication-Info: Submitted using SMTP AUTH at out014.verizon.net from [66.15.127.235] at Tue, 25 Jan 2005 11:51:19 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.079 tagged_above=0 required=5 tests=AWL, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200501/225 X-Sequence-Number: 20013 Yes I am using datepart, but not seeing how with a datediff. Maybe I just need to do the date math and put a date part on the result. I will play around a bit when I hit one not looking for days. 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. =A9 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: Achilleus Mantzios [mailto:achill@matrix.gatewaynet.com]=20 Sent: Tuesday, January 25, 2005 11:34 AM To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] datediff is there something like it? O Joel Fradkin =DD=E3=F1=E1=F8=E5 =F3=F4=E9=F2 Jan 25, 2005 : > Hi all working my way through our views and all is going very well. >=20 > We use datediff in MSSQL a bit and I read about the field1::date - > field2::date to return the days numerically. >=20 > Is there any way to get months and years besides guessing days / 30 = for > months etc? Go to=20 http://www.postgresql.org/docs/7.4/interactive/functions-datetime.html Check out smth like... SELECT 'Achilleus is ' || date_part('years',age(timestamp '1969-01-31')) = || ' years and ' || date_part('months',age(timestamp '1969-01-31')) || ' = months old'; ?column? ----------------------------------------- Achilleus is 35 years and 11 months old (1 row) >=20 > =20 >=20 > Joel Fradkin >=20 > =20 >=20 > Wazagua, Inc. > 2520 Trailmate Dr > Sarasota, Florida 34243 > Tel. 941-753-7111 ext 305 >=20 > =20 >=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 >=20 >=20 > =20 >=20 > =20 >=20 >=20 --=20 -Achilleus