Error While conveting date from csv file

  • Hi,

    I have column paid_date which has to be converted to time stamp and dump in oracle.

    I am using the dervied column but keep getting the error

    Derived column:

    (DT_DBTIMESTAMP)(SUBSTRING(paid_date,1,4) + "-" + SUBSTRING(paid_date,5,2) + "-" + SUBSTRING(paid_date,7,2) + " " + SUBSTRING(paid_date,11,9))

    Shaun

  • Try converting paid_date to varchar before using substring. Something like this:

    select SUBSTRING(convert(varchar(25), paid_date),1,4) + '-' + SUBSTRING(convert(varchar(25), paid_date),5,2) + '-' + SUBSTRING(convert(varchar(25), paid_date),7,2) + ' ' + SUBSTRING(convert(varchar(25), paid_date),11,9)

    Mark

  • its working now... thanks mark..

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply