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).错误,何解?
DataModule4.ADOQuery['计划完成时间']能返回什么值?
select * from plan_tab where 完成时间>'''+formatdatetime('yyyy/mm/dd hh:mm:ss',DataModule4.ADOtable['计划完成时间'].asdatetime //试试 )+'''SQL
)+'''SQL
...;
...;