sql.add('select * from xkzdb where xkzh >'+''''+combobox3.text+''''+' and xkzh <'+''''+combobox4.text+'''')

解决方案 »

  1.   

    sql.add('select * from xkzdb where xkzh >'+''''+combobox3.text+''''+' and xkzh <'+''''+combobox4.text+'''') 
    这样写还是查不出来。
    帮忙!
      

  2.   

    begin
    with dm.query1 do
    begin
      close;
      sql.clear;
      sql.add('select * from xkzdb where xkzh>=' +
      strtoint(combobox3.text) + 'and xkzh<=' + strtoint(combobox4.text));
    end; 
    end;再者,请问楼主,此字段(xkzh)输入时是不是按数字输入?
      

  3.   

    begin
    with dm.query1 do
    begin
      close;
      sql.clear;
      sql.add('select * from xkzdb where strtoint(xkzh)>=' +
      strtoint(combobox3.text) + 'and strtoint(xkzh)<=' + strtoint(combobox4.text));
    end; 
    end;再者,请问楼主,此字段(xkzh)输入时是不是按数字输入? 
      

  4.   

    你的字段是什么类型?整型的话,要把combobox4.text转化成整型
      

  5.   

    xkzh是 ALPHA型。
    它是由321000+日期+ 当天增加的记录数+ 专业代号   组成 是自动生成的
    请大家帮帮忙!