The date value from source is expected to be in "yyyy-mm-dd" format. But one of the source files has different formats "yyyy-mm-dd", "dd-mm-yyyy", "mm-dd-yyyy".(Mixture of correct and incorrect formats). I'm trying to eliminate the incorrect formats using the below derivation
Source field - CRTDST_DATE - VarChar (10)
Target field - CRTDST_DATE - Date(4)
Code: Select all
If Len (TransRec.CRTDST_DATE) < 10 OR Not(IsValid('Date',TransRec.CRTDST_DATE)) Then SetNull() Else StringToDate(TransRec.CRTDST_DATE,"%yyyy-%mm-%dd")
Code: Select all
If Len (TransRec.CRTDED_DATE) < 10 OR Not(IsValid('Date',TransRec.CRTDED_DATE)) Then SetNull() Else StringToDate(TransRec.CRTDED_DATE,"%yyyy-%mm-%dd")
Transformer23,0: Data string '05-05-2007' does not match format '%yyyy-%mm-%dd': the value for tag %yyyy has fewer characters than expected.
Data string '05-31-2008' does not match format '%yyyy-%mm-%dd': the value for tag %yyyy has fewer characters than expected.
Any suggestions please.
Many Thanks & Kind Regards