converting varchar to Date and validation
Posted: Mon Dec 05, 2011 11:42 am
Hi,
My source is flatfile . I have date data in varchar type iin my source.
My goal is covert the varchar to date format and vheck for valid date format (%yyyy-%mm-%dd)
In Transformation In Constrains I used following
IsValid( DSLink2.Date,TrimLeadingTrailing( StringToDate(DSLink2.Date,"%yyyy-%mm-%dd")))
And in column Derivation i trie dthe following:
If len(TrimLeadingTrailing( DSLink2.Date))=10 Then StringToDate(DSLink2.Date,"%yyyy-%mm-%dd") Else ' '
But it is not working . Please can any body tell me the solutions
My source is flatfile . I have date data in varchar type iin my source.
My goal is covert the varchar to date format and vheck for valid date format (%yyyy-%mm-%dd)
In Transformation In Constrains I used following
IsValid( DSLink2.Date,TrimLeadingTrailing( StringToDate(DSLink2.Date,"%yyyy-%mm-%dd")))
And in column Derivation i trie dthe following:
If len(TrimLeadingTrailing( DSLink2.Date))=10 Then StringToDate(DSLink2.Date,"%yyyy-%mm-%dd") Else ' '
But it is not working . Please can any body tell me the solutions