有ADOQuery1 ,DBLookupComboBox1,
DBLookupComboBox1已经与数据库表a 中的日期类型字段日期绑定
现在想通过点击DBLookupComboBox1,实现按日期检索代码如下:
with  ADOQuery1 
do begin 
Close;
sql.Clear;
sql.Add('select * from a where time=:a ');
Parameters.ParamByName('a').Value:=formatdatetime('yyyy-mm-dd',strtodate(DBLookupComboBox1.text));
open;
end; 
可是编译通过,但运行时报错!
project project1.exe faised exception class econverterror with message '''is not a valid date'.process stopped.