pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yasir Malik <ymalik@cs.stevens-tech.edu>
To: jinujosein@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: DateDiff in PostgreSQL
Date: Fri, 7 Nov 2003 08:45:16 -0500
Message-ID: <Pine.SGI.4.58.0311070844400.37772@guinness.cs.stevens-tech.edu> (raw)

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



view thread (6+ messages)  latest in thread

Message-ID: <Pine.SGI.4.58.0311070844400.37772@guinness.cs.stevens-tech.edu>
Permalink:  ../Pine.SGI.4.58.0311070844400.37772@guinness.cs.stevens-tech.edu/
Also on:    postgresql.org/message-id/Pine.SGI.4.58.0311070844400.37772@guinness.cs.stevens-tech.edu

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ymalik@cs.stevens-tech.edu, jinujosein@yahoo.com
  Subject: Re: DateDiff in PostgreSQL
  In-Reply-To: <Pine.SGI.4.58.0311070844400.37772@guinness.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