不能将null值转换成双精度值还是把源码贴出来看把,这样的错误可能性太多

解决方案 »

  1.   

    select * from plan_tab where 完成时间>'''+formatdatetime('yyyy/mm/dd hh:mm:ss',DataModule4.ADOtable['计划完成时间'])+'''SQL语句运行正常,连接同样的表,用ADOQuery替换ADOtable(即select * from plan_tab where 完成时间>'''+formatdatetime('yyyy/mm/dd hh:mm:ss',DataModule4.ADOQuery['计划完成时间'])+'''SQL)时运行就会出现could not convert variant of type (null) into type (double).错误,何解?
      

  2.   

    DataModule4.ADOQuery['计划完成时间']能返回什么值?
      

  3.   

    select * from plan_tab where 完成时间>'''+formatdatetime('yyyy/mm/dd hh:mm:ss',DataModule4.ADOtable['计划完成时间'].asdatetime //试试
    )+'''SQL
      

  4.   

    用DBgrid来显示数据的,除DataModule4.ADOQuery['计划完成时间']字段不能showmessage()外,其余都可以showmessage();这字段出了什么问题?
      

  5.   

    如果你确定其他都没有问题,并且你的表也确实有'计划完成时间'这个子段的话,那就说明'计划完成时间'这个字段的值就是空值(NULL)null值是不能转换成字符串的!!!
      

  6.   

    null值也不能转换成时间日期型!!!作一下判断再处理吧if not DataModule4.ADOQuery.FieldByName.IsNull then
       ...;
      

  7.   

    漏了字段名了null值也不能转换成时间日期型!!!作一下判断再处理吧if not DataModule4.ADOQuery.FieldByName('计划完成时间').IsNull then
       ...;