X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8DF72D1B4E1 for ; Fri, 7 Nov 2003 13:54:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15519-02 for ; Fri, 7 Nov 2003 09:53:40 -0400 (AST) Received: from web14909.mail.yahoo.com (web14909.mail.yahoo.com [216.136.225.61]) by svr1.postgresql.org (Postfix) with SMTP id 4BD37D1B507 for ; Fri, 7 Nov 2003 09:53:36 -0400 (AST) Message-ID: <20031107135335.29716.qmail@web14909.mail.yahoo.com> Received: from [202.9.168.133] by web14909.mail.yahoo.com via HTTP; Fri, 07 Nov 2003 05:53:35 PST Date: Fri, 7 Nov 2003 05:53:35 -0800 (PST) From: "George A.J" Subject: Re: DateDiff in PostgreSQL To: Yasir Malik Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1155965565-1068213215=:28965" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=EMAIL_ATTRIBUTION, HTML_10_20, IN_REP_TO X-Spam-Level: X-Archive-Number: 200311/41 X-Sequence-Number: 15856 --0-1155965565-1068213215=:28965 Content-Type: text/plain; charset=us-ascii Yasir Malik wrote: >You can use the age() function to find the difference between dates, and >use the extract() function to get the years, months, days, etc. >Yasir this will not work because age('25/12/1975','30/01/1986') wil return '10 year 1 month 5 days' extract only returns years -10, moths-1, days-5. this is not i want.Actual month difference between the dates are 121 months. jinu jose --------------------------------- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard --0-1155965565-1068213215=:28965 Content-Type: text/html; charset=us-ascii


Yasir Malik <ymalik@heineken.cs.stevens-tech.edu> wrote:

>You can use the age() function to find the difference between dates, and
>use the extract() function to get the years, months, days, etc.
>Yasir

this will not work because age('25/12/1975','30/01/1986')
wil return '10 year 1 month 5 days'

extract only returns years -10, moths-1, days-5.

this is not i want.Actual month  difference between the dates are 121 months.

jinu jose

 


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard --0-1155965565-1068213215=:28965--