adoquery1.Close;
adoquery1.SQL.Text:='select * from zpmx where '+combobox1.Text+combobox2.Text+':N1';
adoquery1.Parameters.ParamValues['N1']:=edit1.Text;
adoquery1.Open;
combobox1.text为字段,combobox2.txt为“<,>,="选项。查询的时间<时正常,>时查出来是大于等于的情况。等于时不正常查不到
adoquery1.SQL.Text:='select * from zpmx where '+combobox1.Text+combobox2.Text+':N1';
adoquery1.Parameters.ParamValues['N1']:=edit1.Text;
adoquery1.Open;
combobox1.text为字段,combobox2.txt为“<,>,="选项。查询的时间<时正常,>时查出来是大于等于的情况。等于时不正常查不到
sql_str:='select * from zpmx'+''+'where n1='+#39+edit1.text+#39;
with adoquery1 do
begin
close;
sql.clear;
sql.add(sql_str);
open;
end;
最好用datetimepicker来选取时间吧
select * from 报告单 where 报告日期=#1979-10-18# 如果是时间
时间里面要用两个:号,
select * from 报告单 where 报告日期=#1979-10-18 16::38::00#
也用在时间的前后加#号来的还是不行