Hi all.
I am loading a DB2 table via the ODBC stage
The source file is ascii text and the source field is varchar 255
The dates in the field are in yyyy-mm-dd format
In the transformer stage I am using the following code:
StringToDate(Trim(lk_SourceFile.DateFld),'%yyyy-%mm-%dd')
The job fails with the following message:
APT_CombinedOperatorController,7: Data string '' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': an integer was expected to match tag %yyyy.
Thanks in advance for your help.
StringToDate does not match format '%yyyy-%mm-%dd %hh:%nn:%s
Moderators: chulett, rschirm, roy
Somewhere in your file you've got at least one value that doesn't match that format. It's also a little confusing that a time portion is mentioned in the error when you are trying to convert to a date.
Still it doesn't seem to like a year that it found.
![Confused :?](./images/smilies/icon_confused.gif)
Still it doesn't seem to like a year that it found.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
data example:
|xxx|xxx|2009-12-15|xxx|xxx|
target data type:
Date length 10
append a zero time to cause an error as well.
to validate the date I removed the ODBC stage add a Seq Stage and wrote all records to a file that passed the test below. All records passed.
IsValid('Date', lk_SourceFile.DateFld) = 1
|xxx|xxx|2009-12-15|xxx|xxx|
target data type:
Date length 10
append a zero time to cause an error as well.
to validate the date I removed the ODBC stage add a Seq Stage and wrote all records to a file that passed the test below. All records passed.
IsValid('Date', lk_SourceFile.DateFld) = 1