how to handle the warnings when using the stingTodate
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 106
- Joined: Wed Oct 04, 2006 5:21 am
how to handle the warnings when using the stingTodate
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
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
-
- Participant
- Posts: 34
- Joined: Fri Sep 22, 2006 10:59 pm
- Location: India
-
- Participant
- Posts: 106
- Joined: Wed Oct 04, 2006 5:21 am
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Try this code.
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.
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.
Mahadev V
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Then use :
Sam
Code: Select all
If IsNull(X) then 'NULL' else StringToDate(X[1,4] :"-" : X[5,2] : "-" : X[7,2], "%yyyy-%mm-%dd")
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: