Page 1 of 1

Date Conversion

Posted: Fri Feb 18, 2011 3:32 am
by jpraveen
Hi All,

I am getting data in CSV File and the date format is mm/dd/yyyy,
in Sequential file i can't view the data
so i made the datatype as Varchar and now i can view the data ,and my output format must be like this YYYY-MM-DD

but when i run the job the job is getting Aborted.

The error message is
DB2Driver Embedded SQL message: SQL0180N The syntax of the string representation of a datetime value is
incorrect. SQLSTATE=22007
In Transformer i made as

Code: Select all

StringToDate(DateToString(LkInto_TRNS_SeqGen.Date,"%mm/%dd/%yyyy"),"%yyyy-%mm-%dd")
please help on this

Posted: Fri Feb 18, 2011 6:34 am
by Vidyut
Try This:
StringToDate(LkInto_TRNS_SeqGen.Date,"%mm/%dd/%yyyy")

Posted: Fri Feb 18, 2011 7:40 am
by chulett
What is your target, another string or a date field? Assuming date from what you posted but you haven't explicitly said. And is your source a string still or did you set it back to a date?

It would probably help if you posted some actual samples of the values you are seeing in the file.