Re: [SQL] Arithmetic operation on DATE

2001-08-13 Thread Karel Zak
On Mon, Aug 13, 2001 at 05:48:57PM +0800, 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 test=# select '2001-08-20'::date

Re: [SQL] Arithmetic operation on DATE

2001-08-13 Thread Christopher Sawtell
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

Re: [SQL] Arithmetic operation on DATE

2001-08-13 Thread Antti Linno
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

Re: [SQL] Arithmetic operation on DATE

2001-08-13 Thread Christopher Sawtell
On Mon, 13 Aug 2001 21:48, macky wrote: > is it possible to add a date datatype column to a number resulting to a > date.. chris=# select date(CURRENT_TIMESTAMP); date 2001-08-13 (1 row) chris=# select date(CURRENT_TIMESTAMP) + '6 @days'::interval; ?column? ---

[SQL] Arithmetic operation on DATE

2001-08-13 Thread macky
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 messa

[SQL] Arithmetic operation on DATE

2001-08-13 Thread macky
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