Skip site navigation (1) Skip section navigation (2)

Re: SQL doubt - Date Add

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: sreejith s <getsreejith(at)gmail(dot)com>
Subject: Re: SQL doubt - Date Add
Date: 2004-10-10 14:36:54
Message-ID: 41694906.3030408@bigfoot.com (view raw or flat)
Thread:
Lists: pgsql-sql
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



In response to

Responses

pgsql-sql by date

Next:From: Gaetano MendolaDate: 2004-10-10 14:37:36
Subject: Re: SQL doubt - Date Add
Previous:From: sreejith sDate: 2004-10-10 14:19:57
Subject: SQL doubt - Date Add

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group