I have a table with date value stored in a char(10) format
CT KVB_DT(MYDATE CHAR(10))
INS INTO KVB_DT VALUES('20130620')
I need to add 7 days to it and it should be in char format as 20130627
I am able to add 7 days by converting it to date
SEL MYDATE,CAST(MYDATE AS DATE FORMAT 'YYYYMMDD') +INTERVAL '7' DAY FROM KVB_DT
problem here is when I am trying to convert it it to char format.
SEL MYDATE,CAST(CAST(MYDATE AS DATE FORMAT 'YYYYMMDD') +INTERVAL '7' DAY AS CHAR(10) FORMAT 'YYYYMMDD') FROM KVB_DT
It is throwing error YYYYMMDDdoesnt match the data type
Forums: