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