Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.4) with SMTP id f7EGaDP77302 for ; Tue, 14 Aug 2001 12:36:13 -0400 (EDT) (envelope-from pgsql-novice-owner@postgresql.org) Received: from all.all.ee (puu.all.ee [194.204.49.113]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7DA4hP89358; Mon, 13 Aug 2001 06:04:43 -0400 (EDT) (envelope-from alligator@all.ee) Received: from localhost (localhost [127.0.0.1]) by all.all.ee (8.9.3/8.9.3) with ESMTP id MAA07228; Mon, 13 Aug 2001 12:02:17 +0200 Date: Mon, 13 Aug 2001 12:02:17 +0200 (EET) From: Antti Linno To: macky cc: pgsql-sql@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [SQL] Arithmetic operation on DATE In-Reply-To: <008301c123db$ba9791f0$5764a8c0@edsamail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200108/59 X-Sequence-Number: 1865 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 >