pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antti Linno <alligator@all.ee>
To: macky <macky@edsamail.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-novice@postgresql.org
Subject: Re: [SQL] Arithmetic operation on DATE
Date: Mon, 13 Aug 2001 12:02:17 +0200 (EET)
Message-ID: <Pine.LNX.4.04.10108131159090.5034-100000@all.ee> (raw)
In-Reply-To: <008301c123db$ba9791f0$5764a8c0@edsamail.com>

Ok, so here's my small knowledge on this matter

select date(date('2001-08-20')+interval('6 months'));

    date    
------------
 2002-02-20

I'm sure there's more elegant and shorter ways of doing this, but a quick
answer, maybe you're stuck somewhere :)

	Antti

Tested it on 7.0.2.


On Mon, 13 Aug 2001, macky wrote:

> is it possible to add a date datatype column to a number resulting to a
> date......
> 
> 
> 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@postgresql.org so that your
> message can get through to the mailing list cleanly
> 




view thread (8+ messages)  latest in thread

Message-ID: <Pine.LNX.4.04.10108131159090.5034-100000@all.ee>
Permalink:  ../Pine.LNX.4.04.10108131159090.5034-100000@all.ee/
Also on:    postgresql.org/message-id/Pine.LNX.4.04.10108131159090.5034-100000@all.ee

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: alligator@all.ee, macky@edsamail.com, pgsql-novice@postgresql.org
  Subject: Re: [SQL] Arithmetic operation on DATE
  In-Reply-To: <Pine.LNX.4.04.10108131159090.5034-100000@all.ee>
  References: <008301c123db$ba9791f0$5764a8c0@edsamail.com> <Pine.LNX.4.04.10108131159090.5034-100000@all.ee>

* 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