From jfradkin@wazagua.com Tue Jan 25 15:08:52 2005 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 E45393A568A for ; Tue, 25 Jan 2005 15:08:52 +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 71371-08 for ; Tue, 25 Jan 2005 15:08:38 +0000 (GMT) Received: from out008.verizon.net (out008pub.verizon.net [206.46.170.108]) by svr1.postgresql.org (Postfix) with ESMTP id 237C33A5757 for ; Tue, 25 Jan 2005 15:08:33 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by out008.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050125150833.TRDZ17379.out008.verizon.net@jfradkin> for ; Tue, 25 Jan 2005 09:08:33 -0600 From: "Joel Fradkin" To: Subject: datediff is there something like it? Date: Tue, 25 Jan 2005 10:11:40 -0500 Message-ID: <000001c502f0$2d10a7c0$797ba8c0@jfradkin> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C502C6.443A9FC0" X-Authentication-Info: Submitted using SMTP AUTH at out008.verizon.net from [66.15.127.235] at Tue, 25 Jan 2005 09:08:33 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.079 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200501/214 X-Sequence-Number: 20002 This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C502C6.443A9FC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all working my way through our views and all is going very well. We use datediff in MSSQL a bit and I read about the field1::date - field2::date to return the days numerically. Is there any way to get months and years besides guessing days / 30 for months etc? Joel Fradkin Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 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. ------=_NextPart_000_0001_01C502C6.443A9FC0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all working my way through our views and all is = going very well.

We use datediff in MSSQL a bit and I read about the field1::date – field2::date to return the days = numerically.

Is there any way to get months and years besides = guessing days / 30 for months etc?

 

Joel Fradkin

 

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida = 34243
Tel.  941-753-7111 ext 305

 

jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced = tools.
© 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.

 


 

 

------=_NextPart_000_0001_01C502C6.443A9FC0-- From achill@matrix.gatewaynet.com Tue Jan 25 15:57:41 2005 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 302C13A5578 for ; Tue, 25 Jan 2005 15:57:41 +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 78206-01 for ; Tue, 25 Jan 2005 15:57:27 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 10A473A5762 for ; Tue, 25 Jan 2005 15:57:28 +0000 (GMT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j0PGXUcN000370; Tue, 25 Jan 2005 18:33:30 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j0PGXUF2000366; Tue, 25 Jan 2005 18:33:30 +0200 Date: Tue, 25 Jan 2005 18:33:30 +0200 (EET) From: Achilleus Mantzios To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: datediff is there something like it? In-Reply-To: <000001c502f0$2d10a7c0$797ba8c0@jfradkin> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/215 X-Sequence-Number: 20003 O Joel Fradkin έγραψε στις Jan 25, 2005 : > Hi all working my way through our views and all is going very well. > > We use datediff in MSSQL a bit and I read about the field1::date - > field2::date to return the days numerically. > > Is there any way to get months and years besides guessing days / 30 for > months etc? Go to 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) > > > > Joel Fradkin > > > > Wazagua, Inc. > 2520 Trailmate Dr > Sarasota, Florida 34243 > Tel. 941-753-7111 ext 305 > > > > 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. > > > > > > > > > -- -Achilleus From jfradkin@wazagua.com Tue Jan 25 17:51:26 2005 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 From oleg@sai.msu.su Tue Jan 25 19:03:41 2005 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 D60393A45E6 for ; Tue, 25 Jan 2005 19:03:41 +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 06238-02 for ; Tue, 25 Jan 2005 19:03:31 +0000 (GMT) Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by svr1.postgresql.org (Postfix) with ESMTP id 85A913A57C4 for ; Tue, 25 Jan 2005 19:03:30 +0000 (GMT) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.12.10/8.12.10) with ESMTP id j0PJ3L5Q006063; Tue, 25 Jan 2005 22:03:21 +0300 (MSK) Date: Tue, 25 Jan 2005 22:03:21 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@ra.sai.msu.su To: Joel Fradkin Cc: "'Achilleus Mantzios'" , pgsql-sql@postgresql.org Subject: Re: datediff is there something like it? In-Reply-To: <000201c50306$e9c1b380$797ba8c0@jfradkin> Message-ID: References: <000201c50306$e9c1b380$797ba8c0@jfradkin> MIME-Version: 1.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.678 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, URIBL_SBL X-Spam-Level: Content-Type: TEXT/PLAIN; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8BIT X-Archive-Number: 200501/234 X-Sequence-Number: 20022 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-912437380-1106679801=:6363 Content-Type: TEXT/PLAIN; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 25 Jan 2005, Joel Fradkin wrote: > 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. > http://www.pgsql.ru/db/pgsearch/index.html?q=datediff > Joel Fradkin > > Wazagua, Inc. > 2520 Trailmate Dr > Sarasota, Florida 34243 > Tel. 941-753-7111 ext 305 > > jfradkin@wazagua.com > www.wazagua.com > Powered by Wazagua > Providing you with the latest Web-based technology & advanced tools. > Ώ 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. > > > > > -----Original Message----- > From: Achilleus Mantzios [mailto:achill@matrix.gatewaynet.com] > 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 ?????? ???? Jan 25, 2005 : > >> Hi all working my way through our views and all is going very well. >> >> We use datediff in MSSQL a bit and I read about the field1::date - >> field2::date to return the days numerically. >> >> Is there any way to get months and years besides guessing days / 30 for >> months etc? > > Go to > 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) > > > >> >> >> >> Joel Fradkin >> >> >> >> Wazagua, Inc. >> 2520 Trailmate Dr >> Sarasota, Florida 34243 >> Tel. 941-753-7111 ext 305 >> >> >> >> 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. >> >> >> >> >> >> >> >> >> > > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83 ---559023410-912437380-1106679801=:6363-- From bruno@wolff.to Wed Jan 26 19:59:06 2005 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 DD9923A5D37 for ; Wed, 26 Jan 2005 19:59:06 +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 51451-05 for ; Wed, 26 Jan 2005 19:59:00 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 9FA1E3A5CF3 for ; Wed, 26 Jan 2005 19:59:00 +0000 (GMT) Received: (qmail 24170 invoked by uid 500); 26 Jan 2005 20:13:19 -0000 Date: Wed, 26 Jan 2005 14:13:19 -0600 From: Bruno Wolff III To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: datediff is there something like it? Message-ID: <20050126201319.GA23744@wolff.to> Mail-Followup-To: Joel Fradkin , pgsql-sql@postgresql.org References: <000001c502f0$2d10a7c0$797ba8c0@jfradkin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c502f0$2d10a7c0$797ba8c0@jfradkin> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/270 X-Sequence-Number: 20058 On Tue, Jan 25, 2005 at 10:11:40 -0500, Joel Fradkin wrote: > Hi all working my way through our views and all is going very well. > > We use datediff in MSSQL a bit and I read about the field1::date - > field2::date to return the days numerically. > > Is there any way to get months and years besides guessing days / 30 for > months etc? The age function will give a difference in years-months in addition to days-hours-minutes-seconds. Depending on what you want, it may not do exactly what you want.