"DateTimePicker1.Date" and "DateTimePicker2.date" 错误在这里。自己好好看看
dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj between ''' + DateTimeToStr(DateTimePicker1.Date) + ''' and ''' + DateTimeToStr(DateTimePicker2.date)'''');
delphi里对STRING操作是用单引号的。
dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj>= '''+DateTimePicker1.Date+''' and jfsj<='''+DateTimePicker2.date+'''');
"DateTimePicker1.Date" and "DateTimePicker2.date" 错了,要改为字符串
between ''' + DateTimeToStr(DateTimePicker1.Date) + ''' and ''' +
DateTimeToStr(DateTimePicker2.date)'''');
dm.xiaosou_adoquery.SQL.Add('select * from xiaosou_biao where jfsj>=
'''+DateTimePicker1.Date+''' and jfsj<='''+DateTimePicker2.date+'''');