From: Yasir Malik <ymalik@heineken.cs.stevens-tech.edu>
To: George A.J <jinujosein@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: DateDiff in PostgreSQL
Date: Fri, 7 Nov 2003 08:40:52 -0500 (EST)
Message-ID: <Pine.LNX.4.58.0311070839130.20653@heineken.cs.stevens-tech.edu> (raw)
In-Reply-To: <20031107133409.25844.qmail@web14909.mail.yahoo.com>
References: <20031107133409.25844.qmail@web14909.mail.yahoo.com>
Hi,
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
On Fri, 7 Nov 2003, George A.J wrote:
> Date: Fri, 7 Nov 2003 05:34:09 -0800 (PST)
> From: George A.J <jinujosein@yahoo.com>
> To: pgsql-sql@postgresql.org
> Subject: [SQL] DateDiff in PostgreSQL
>
>
> Hi,
>
> i am converting a MSSQL Server database to PostgreSQL.
>
> Using PostgreSQL version 7.3.2.
>
> Is there any function like the DateDiff() in MSSQL Server.
>
> ie, a function that returns difference of two dates(timestamp) in days or months or year..
>
> The - operator for timestamp retuns the intervel in days only.
>
> Please help
>
> jinujose
>
>
> ---------------------------------
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: ymalik@heineken.cs.stevens-tech.edu, jinujosein@yahoo.com
Subject: Re: DateDiff in PostgreSQL
In-Reply-To: <Pine.LNX.4.58.0311070839130.20653@heineken.cs.stevens-tech.edu>
References: <20031107133409.25844.qmail@web14909.mail.yahoo.com> <Pine.LNX.4.58.0311070839130.20653@heineken.cs.stevens-tech.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox