date timeconversion
Hi, I a getting a string of length 26 '20120710120700 ' I am using this in derived column (DT_DBTIMESTAMP)(RTRIM([Column 34])) to convert into DBTime stamp, But i am getting row disposition error. Please help me.
July 11th, 2012 4:12pm

this conversion is unreliable for SSIS engine since it needs to assume where what is. ISO format gets converted though, but since your string is not you need to do it by chunks in the derived column transform. E.g. SUBSTRING(Column34, 1,4) + SUBSTRING(... - to get the year and then month until you finally construct a proper date and time to convert.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2012 4:30pm

just to add complete expression to Arthur's explanation:  (DT_DBTIMESTAMP)( substring([Column34],1,4)+"-"+ substring([Column34],5,2)+"-"+ substring([Column34],7,2)+" "+ substring([Column34],9,2)+":"+ substring([Column34],11,2)+":"+ substring([Column34],13,2) ) http://www.rad.pasfu.com
July 11th, 2012 6:01pm

just to add complete expression to Arthur's explanation:  (DT_DBTIMESTAMP)( substring([Column34],1,4)+"-"+ substring([Column34],5,2)+"-"+ substring([Column34],7,2)+" "+ substring([Column34],9,2)+":"+ substring([Column34],11,2)+":"+ substring([Column34],13,2) ) http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2012 6:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics