From: | "Cornelia Boenigk" <poppcorn(at)cornelia-boenigk(dot)de> |
---|---|
To: | "pgsql-general" <pgsql-general(at)postgresql(dot)org> |
Subject: | Problem with date calculations |
Date: | 2004-01-10 22:36:01 |
Message-ID: | 006301c3d7ca$2c43eac0$0201a8c0@zwerg2000 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi alltogether
I have a table with two fields, d1 timestamp and dur smallint.
d1 is the starting date and dur is the duration. From this two fields
I want to generate future dates for the whole table.
There is no problem with queries where a number for the duration is
given.
test=# select d1,dur,d1 + '6 month' from t1;
d1 | dur | ?column?
-----------------------+-----+---------------------
2003-12-27 00:00:00 | 4 | 2004-06-27 00:00:00
2003-11-14 00:00:00 | 7 | 2004-05-14 00:00:00
2004-01-03 00:00:00 | 5 | 2004-07-03 00:00:00
I want to have the date plus the duration stored in the table, but
didn't succeed.
test=# select '\''||dur::varchar||' month\'' from t1;
?column?
-----------
'4 month'
'7 month'
'5 month'
but
test=# select d1 + '\''||wielange::varchar||' month\'' from t1;
ERROR: invalid input syntax for type interval: "'"
Any hints are welcome
Regards
Conni
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2004-01-10 22:54:20 | Re: Problem with date calculations |
Previous Message | D. Dante Lorenso | 2004-01-10 21:31:28 | Bug with rename bigserial column |