riqi1:=ComboBox2.Text+'-'+ComboBox3.Text+'-'+ComboBox4.Text;
riqi2:=ComboBox2.Text+'-'+ComboBox5.Text+'-'+ComboBox6.Text;
fstr:='select * from 销售库 where 日期>='+strtodatetime(riqi1)+' and  日期<='+strtodatetime(riqi2);

解决方案 »

  1.   

    fstr:='select * from 销售库 where (日期>=''%s'') and (日期<=''%s'')';
      

  2.   

    你说的那个问题是access的字符表现形式,用在sql server中,你用'''就可以了
      

  3.   

    还是不对啊:(请你写的具体一点好吗?
    riqi1:='2001-1-1';
    riqi2:='2001-3-3'fstr:='select * from 销售库 where (日期>=''riqi1'') and (日期<=''riqi2'')';
    这样对吗?
      

  4.   

    riqi1:='2001-1-1';
    riqi2:='2001-3-3';
    fstr:='select * from 销售库 where (日期>='''+riqi1+''') and (日期<='''+riqi2+''')';