sql.add('select * from 销售情况 where '''+combobox1.text'''')
你可以把此代码写在combobox1的change事件里面 with Query1 do begin Close; sql.text:='select * from yourtable where 付款方式=:FKFS'; ParamByName('FKFS').asString:=combox1.text; Open; end;
sql.add('select * from 销售情况 where '''+combobox1.text+'''')//刚才那个少了个+
sql.text :=format('select * from yourtable where 付款方式=%s',combox1.text)
sql.text :='select * from 销售情况 where 付款方式 = '''+combox1.text+''''; open;
推荐 SmallHand(火龍)的写法
change事件里面 select * from 销售情况 where 付款方式 = '''+combox1.text+''''
with Query1 do
begin
Close;
sql.text:='select * from yourtable where 付款方式=:FKFS';
ParamByName('FKFS').asString:=combox1.text;
Open;
end;
open;
select * from 销售情况 where 付款方式 = '''+combox1.text+''''