我做了一个销售管理系统,我在查询销售情况时,我想查询已付或未付款的货物,已付和未付通过combobox1.text选择,而且在表中也有付款方式这个字段,请问该怎么做啊?
select * from 销售情况 where 付款方式???后面怎么写啊?请高手指点?

解决方案 »

  1.   

    sql.add('select * from 销售情况 where '''+combobox1.text'''')
      

  2.   

    你可以把此代码写在combobox1的change事件里面
    with Query1 do
    begin
      Close;
      sql.text:='select * from yourtable where 付款方式=:FKFS';
      ParamByName('FKFS').asString:=combox1.text;
      Open;
    end;
      

  3.   

    sql.add('select * from 销售情况 where '''+combobox1.text+'''')//刚才那个少了个+
      

  4.   

    sql.text :=format('select * from yourtable where 付款方式=%s',combox1.text)
      

  5.   

    sql.text :='select * from 销售情况 where 付款方式 = '''+combox1.text+'''';
    open;
      

  6.   

    推荐 SmallHand(火龍)的写法
      

  7.   

    change事件里面
     select * from 销售情况 where 付款方式 = '''+combox1.text+''''