Hey,
the following code I have in transformer
if IsValid('Date', StringToDate("99991235" ,"%yyyy%mm%dd"))= 0 then setnull() else StringToDate("99991225" ,"%yyyy%mm%dd")
The result, its setting null correctly but I am getting a warning and a FATAL message. The following are the messgaes
Warning :
APT_CombinedOperatorController,0: Conversion error calling conversion routine date_from_string data may have been lost
Fatal:
Data string '**********' does not match format '%yyyy-%mm-%dd': an integer was expected to match tag %yyyy.
O/p result:
Peek_6,0: date:NULL
may i know how do u eliminate this Warning and fatal error??
IS VALID () Fatal error message
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: IS VALID () Fatal error message
Do you have any character string in your input data.gsym wrote:Hey,
the following code I have in transformer
if IsValid('Date', StringToDate("99991235" ,"%yyyy%mm%dd"))= 0 then setnull() else StringToDate("99991225" ,"%yyyy%mm%dd")
The result, its setting null correctly but I am getting a warning and a FATAL message. The following are the messgaes
Warning :
APT_CombinedOperatorController,0: Conversion error calling conversion routine date_from_string data may have been lost
Fatal:
Data string '**********' does not match format '%yyyy-%mm-%dd': an integer was expected to match tag %yyyy.
O/p result:
Peek_6,0: date:NULL
may i know how do u eliminate this Warning and fatal error??
probably ******** if its the same message in your log.
In case of character string the StringToDate() will fail.
Try validating it before passing it to the function if its 8 character long numeric.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
Tried with string and still getting error
kduke wrote:IsValid is expecting a string not a date. Take the StringToDate out of your expression. ...
Did you mean to say:
if IsValid('Date', '99991235' ) = 0 then setnull() else StringToDate("99991225" ,"%yyyy%mm%dd")
if yes, I am still getting fatal error as
Data string '99991235' does not match format '%yyyy-%mm-%dd': an integer was expected to match tag %dd.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What is the default date format for your installation? The IsValid function is probably expecting the date in that format. From the error message it seems that your default format must be "%yyyy-%mm-%dd".
Does this work for you?
Mike
Does this work for you?
Code: Select all
If IsValid("date", "9999-12-35") = 0 then SetNull() else StringToDate("99991225" ,"%yyyy%mm%dd")
You were right, Actually I tried this and wanted to post back that its resolved, But found you have already posted it......Mike wrote:What is the default date format for your installation? The IsValid function is probably expecting the date in that format. From the error message it seems that your default format must be "%yyyy-%mm-%dd".
Does this work for you?MikeCode: Select all
If IsValid("date", "9999-12-35") = 0 then SetNull() else StringToDate("99991225" ,"%yyyy%mm%dd")
Thanks guys