Re: [SQL] Date question - Mailing list pgsql-general

From Michael Fork
Subject Re: [SQL] Date question
Date
Msg-id Pine.BSI.4.21.0103061425570.5931-100000@glass.toledolink.com
Whole thread Raw
In response to Date question  (Boulat Khakimov <boulat@inet-interactif.com>)
List pgsql-general
This will do it:

mfork=# SELECT to_char(now() + '1 Year'::interval, 'YYYY-MM-DD');
  to_char
------------
 2002-03-06
(1 row)

Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio

On Tue, 6 Mar 2001, Boulat Khakimov wrote:

> Hi,
>
> Im a little bit stuck here.
>
> Does anyone know how to get date in format 'YYYY-MM-DD' of a date one
> year from now.
> So for example today is '2001-03-06' I need to get date 12 months from
> now
> which will be '2002-03-06' in todays case...
>
> In mysql I used  DATE_ADD(CURDATE(), INTERVAL 12 MONTH) , but that
> doesnt work in PG.
>
>
> Regards,
> Boulat Khakimov
>
>
> --
> Nothing Like the Sun
>


pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: RE: Date question
Next
From: "Gregory Wood"
Date:
Subject: Re: SQL article