问题解决了
改写一下sql 语句
begin
if adoquery2.active then adoquery2.close;
adoquery2.SQL.Clear;
sql1:='select * from tblprojects'+
' where '+
' prjENDingdatetime between :datestart and :dateend ';
if CheckBox2.Checked then
sql1:=sql1+' and ProjectName like ''%'+ trim(edit1.text)+'%''';
if CheckBox3.checked then
sql1:=sql1+ ' and projectstatus like ''%'+trim(ComboBox1.text)+'%''';
if CheckBox4.Checked then
sql1:=sql1+ ' and ProjectPayment like ''%'+trim(ComboBox2.text)+'%''';
sql1:=sql1+' ORDER BY prjENDingdatetime DESC';
adoquery2.SQL.Text:=sql1;
adoquery2.Parameters.ParamByName('datestart').value:=datetimepicker1.DateTime;
adoquery2.Parameters.ParamByName('dateend').value:=datetimepicker2.DateTime;
adoquery2.open;
end;
感谢各位富翁