Page 1 of 1

how to handle the warnings when using the stingTodate

Posted: Mon Dec 11, 2006 11:30 pm
by thumati.praveen
hi all,

when i am trying to validate the input field type is char and convert to date,it is generating the warnings like...

xfmIIPNT0: Conversion error calling conversion routine date_from_string data may have been lost

can u provide the best input for this warnings.

thanks inadvance
praveen

Posted: Mon Dec 11, 2006 11:40 pm
by BalageBaju
Hi,

First Trim that field and then apply 'StringToDate' function.
Hope this will help you...

Posted: Tue Dec 12, 2006 12:23 am
by thumati.praveen
BalageBaju wrote:Hi,

First Trim that field and then apply 'StringToDate' function.
Hope this will help you...
I used TrimLeadingandTrilig funcion,but warning is still comining

Posted: Tue Dec 12, 2006 12:28 am
by ajith
thumati.praveen wrote:
I used TrimLeadingandTrilig funcion,but warning is still comining

can u post the transformation you are doing and the datatypes and lengths of inputs and outputs. More importantly, Check whether your conversion works, If everything is fine, just ignore the warnings, It signifies nothing then.

If you have a problem with the data, please post the problem in details so that others can help you out.

Thanks,
Ajith

Posted: Tue Dec 12, 2006 1:36 am
by ray.wurlod
What Ajith is suggesting is that your string dates may contain more information than can be converted to a date type - for example they may really be timestamps, so that the time portion is lost so you get warned that this may be occurring.

Try this code.

Posted: Tue Dec 12, 2006 3:45 am
by Mahadev
Try the following code in a transformer stage. In place of X give your coloumn name.
StringToDate(X[1,4] :"-" : X[5,2] : "-" : X[7,2], "%yyyy-%mm-%dd").
Also check the date format in the input to see if it is "YYYYMMDD". change the code accordingly.

Posted: Sat Dec 23, 2006 6:49 am
by bandish
There might be NULL values in the input column.

Posted: Sat Dec 23, 2006 1:36 pm
by us1aslam1us
Then use :

Code: Select all

 If IsNull(X) then 'NULL' else StringToDate(X[1,4] :"-" : X[5,2] : "-" : X[7,2], "%yyyy-%mm-%dd")
Sam

Posted: Sat Dec 23, 2006 2:45 pm
by ray.wurlod
Still waiting to hear from the original poster what the input format of the dates might be.