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

解决方案 »

  1.   

    "DateTimePicker1.Date" and "DateTimePicker2.date"  错误在这里。自己好好看看
      

  2.   

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

  3.   

    delphi里对STRING操作是用单引号的。
      

  4.   


    dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj>=
    '''+DateTimePicker1.Date+''' and jfsj<='''+DateTimePicker2.date+'''');
      

  5.   

    "DateTimePicker1.Date" and "DateTimePicker2.date"  错了,要改为字符串