pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-sql@postgresql.org
Subject: Re: SQL doubt - Date Add
Date: Sun, 10 Oct 2004 16:37:36 +0200
Message-ID: <ckbhfe$bc3$2@floppy.pyrenet.fr> (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: <ckbhfe$bc3$2@floppy.pyrenet.fr>
Permalink:  ../ckbhfe$bc3$2@floppy.pyrenet.fr/
Also on:    postgresql.org/message-id/ckbhfe$bc3$2@floppy.pyrenet.fr

 · 

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
  Subject: Re: SQL doubt - Date Add
  In-Reply-To: <ckbhfe$bc3$2@floppy.pyrenet.fr>

* 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