pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: sreejith s <getsreejith@gmail.com>
Subject: Re: SQL doubt - Date Add
Date: Sun, 10 Oct 2004 16:36:54 +0200
Message-ID: <41694906.3030408@bigfoot.com> (raw)
In-Reply-To: <5d14ecf904101007197d0acbbf@mail.gmail.com>
References: <5d14ecf904101007197d0acbbf@mail.gmail.com>

sreejith s wrote:
> Hi friends,
>               I problem is i want to add a specified no. of years to a
> given date
> ie, 12/12/2004 + 5 = 12/12/2009. This has to be done via sql. Any 
> predefined function there for the same. or v have split the yr and
> then add.
> Sreejith
>

# select '2004-12-12'::date + 5 * '1 year'::interval;
       ?column?
---------------------
  2009-12-12 00:00:00
(1 row)



Regards
Gaetano Mendola





view thread (4+ messages)  latest in thread

Message-ID: <41694906.3030408@bigfoot.com>
Permalink:  ../41694906.3030408@bigfoot.com/
Also on:    postgresql.org/message-id/41694906.3030408@bigfoot.com

 · 

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: mendola@bigfoot.com, getsreejith@gmail.com
  Subject: Re: SQL doubt - Date Add
  In-Reply-To: <41694906.3030408@bigfoot.com>

* 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