Page 1 of 1

TCRBatchMove EConvertError: '' is not a valid date and time

Posted: Tue 17 Jul 2007 14:28
by swierzbicki
Hi,

I'm getting an EConvertError when my source dataset has date time fields filled with null values.

To bypass this probelm, I have replaced the above code
ftDate, ftTime, ftDateTime:
DestField.AsDateTime := SrcField.AsDateTime;
with
ftDate, ftTime, ftDateTime:
if vartostr(SrcField.value) '' then DestField.AsDateTime := SrcField.AsDateTime;
This is not really clean, but it is working

Posted: Wed 18 Jul 2007 13:01
by Antaeus
It looks strange, as this operatop should not be performed because of this condition above in the code:

Code: Select all

    if SrcField.IsNull then
      DestField.Clear
    else
       
Please check if you changed source code of the CRBatchMove.pas unit.

Posted: Wed 18 Jul 2007 13:01
by Antaeus
It looks strange, as this operatop should not be performed because of this condition above in the code:

Code: Select all

    if SrcField.IsNull then
      DestField.Clear
    else
       
1105;Please check if you changed source code of the CRBatchMove.pas unit.

Posted: Thu 19 Jul 2007 10:04
by swierzbicki
Hi,

Well, that's weird, the field value isn't null but '' (empty string !!!)
I'm transfering datas from an Advantage Database Server to an MySQL Serveur.

The above code is allready here.
if SrcField.IsNull then
DestField.Clear
else

Posted: Fri 27 Jul 2007 08:50
by Antaeus
It is unlikely that we will apply similar change to the TCRBatchMove code, as it looks like an Advantage server issue. Probably a better solution is to replace wrong values using a calculated field (on the server or on the client) instead of the actual field.

Posted: Fri 27 Jul 2007 13:00
by swierzbicki
That's a good idea. I will test the DateTime field in the SQL query so that no empty values will be retreived.

Thank you for this tip