dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj between "'+ DateToStr(DateTimePicker1.Date) +'" and "'+DateToStr(DateTimePicker2.date)+'"');

解决方案 »

  1.   

    把你赋参数的地方,改成规矩点的形式。可以用format,也可以用参数的形式。不要这样写,程序难读,也不容易维护。
      

  2.   

    我来抢分:
    dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj between '+ QuotedStr(DateToStr(DateTimePicker1.Date)) +'and '+QuotedStr(DateToStr(DateTimePicker2.date)));
    有时候如果你的驱动安装不对的话也是有影响的。
      

  3.   

    '  (  jfsj > #'+DateToStr(DateTimePicker1.Date)+'#  and   jfsj < #'+DateToStr(DateTimePicker2.Date)+'#)'
      

  4.   

    同意  wudi_1982(︻┳═一没钱就去挣,没妞就去泡,少扯淡!) ( )  的观点,改用参数的形式