7 Replies Latest reply on Dec 21, 2018 1:02 AM by Nico Heinze

    String to Date Conversion Issue

    New Member

      Hello,

       

      I have the following scenario.

       

      Source: XML

      Field: EntryDate

      DataType: String 

      Format: 'MM/DD/YYYY'

      Example: 03/20/2014

       

      Target:

      Field: EntryDate

      Datatype: Date

       

      In the mapping, I have used an expression T/f to convert the string to date by using an o/p port OUT_ENTRYDATE = TO_DATE(ENTRYDATE,'YYYY/MM/DD').

       

      But I see the EntryDate being populated with all the NULL's in the target table. When I checked the session log, the following error has been displayed.

       

      Transformation [EXP_SetAuditFields] had an error evaluating output column [out_entrydate]. Error message is [<<Expression Error>> [TO_DATE]: invalid string for converting to Date

      ... t:TO_DATE(u:'03/15/2014',u:'YYYY/MM/DD')].

       

       

      Any help is appreciated.

       

      Thanks,

      C