Page 1 of 1

Datatype Conversion Warning.....from StringToDate

Posted: Wed Sep 13, 2006 10:43 pm
by ajmore
Hi :) ,
I am getting Following warning while converting data in string format to date

Transformer :Conversion error calling conversion routine date_from_string data may be lost

The String Length is 8(e.g. 20341221),and I used the StingToDate function and got the output 2034-12-21 but with warnings...
What should be the appropiate Date datatype Length and how i can suppress above warning?? :shock:

Posted: Wed Sep 13, 2006 11:40 pm
by kris007
Can you post the exact derivation from the Transformer stage you have used? It should be

Code: Select all

StringToDate(InputLink.Column, "%yyyy%mm%dd")

Posted: Thu Sep 14, 2006 12:18 am
by ajmore
kris007 wrote:Can you post the exact derivation from the Transformer stage you have used? It should be

Code: Select all

StringToDate(InputLink.Column, "%yyyy%mm%dd")
Thanks for quick response..."Kris007"
I used the following derivation
StringToDate(DDate [1,4] : "-" : DDate [5,2] :"-" : DDate [7,2],"%yyyy-%mm-%dd")
i actually want Date in dd-mm-yyyy format can anyone specify the derivation

Posted: Thu Sep 14, 2006 2:44 am
by ray.wurlod
Dates aren't "in" any particular kind of format. It's only when they are converted to string that format becomes important. Having created a date, as in this thread, you can then apply a DateToString() function and specify an explicit date picture such as "%dd-%mm-%yyyy".

Posted: Thu Sep 14, 2006 8:10 am
by keshav0307
i have same problem when we upgrade to version 7.5.2 , it was not a problem in 7.5.1. check some records may not be convertible to date.
you can try this:
if DDate<19000000 then '1900-01-01' else StringToDate(InputLink.Column, "%yyyy%mm%dd")
[/quote]