Page 1 of 1

Char to Date Datatype

Posted: Mon Aug 30, 2004 2:29 pm
by phillip.small
I have a DB2 column and cannot populate it. My derivation is Ereplace(Oconv(Iconv(DataIN.EFFDT,"D-YMD[4'',2'',2]"), "D-YMD[4'',2'',2]"),"-",'').

Here is one of the error messages: Attempt to convert String value "2004 06 28" to Date type unsuccessful

Some values are null and I have this derivation within an If Else statement to cover the null values but have tried numerous derivations to try to get rid of the spaces and this String conversion is unsuccessful. I have taken out the dash, put a slash, used ICONV, OCONV, and a combination of the two. I have received some other ideas and tried those, and am out of suggestions.

Posted: Mon Aug 30, 2004 7:06 pm
by rasi
for your input string try the following syntax

Iconv(DataIN.EFFDT,"D YMD[4,2,2]")

Thanks
Siva

Posted: Mon Aug 30, 2004 8:03 pm
by chulett
Phillip, this is exactly what Ken told you to do last week in your first post with this question. No 'OConv' needed as the DB2 stage expects the date in internal format.