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

Re: [SQL] Arithmetic operation on DATE

From: Christopher Sawtell <csawtell(at)paradise(dot)net(dot)nz>
To: "macky" <macky(at)edsamail(dot)com>, <pgsql-sql(at)postgresql(dot)org>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [SQL] Arithmetic operation on DATE
Date: 2001-08-13 10:03:40
Message-ID: 20010813100258.9AA3B1FA063@deborah.paradise.net.nz (view raw or flat)
Thread:
Lists: pgsql-novicepgsql-sql
On Mon, 13 Aug 2001 21:38, macky wrote:
> is it possible to add a date datatype column to a number resulting to a
> date......

chris=# select date(date(CURRENT_TIMESTAMP) + '6 @months'::interval);
    date
------------
 2002-02-13
(1 row)

More of what you want?

> theoretically it should do this,,,
>
> X is in months
>
> date + X = date
>
> -->  2001-08-20 + 6 = 2002-02-20
>
>
>
>
>
>
> ----------------------------------------------------------------------
> The information contained in this message (including any attachments)
> is confidential and intended solely for the attention and use of the
> named addressee(s). It must not be copied, distributed nor disclosed
> to any person. If you are not the intended recipient, please delete
> it from your system and notify sender immediately. Any disclosure,
> copying or distribution thereof or any action taken or omitted to be
> taken in reliance thereon is prohibited and may be unlawful.
> ----------------------------------------------------------------------
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

pgsql-novice by date

Next:From: Karel ZakDate: 2001-08-13 10:11:13
Subject: Re: [SQL] Arithmetic operation on DATE
Previous:From: Jason WongDate: 2001-08-13 10:02:34
Subject: Re: Arithmetic operation on DATE

pgsql-sql by date

Next:From: Karel ZakDate: 2001-08-13 10:11:13
Subject: Re: [SQL] Arithmetic operation on DATE
Previous:From: Jason WongDate: 2001-08-13 10:02:34
Subject: Re: Arithmetic operation on DATE

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