麻烦各位啦:
   数据库:access.
   表 A 中有一个的field 为 t_date 是 日期类型的
   
   tmp_record1 : _Recordset
   ateTimePicker1  
   现在要select 记录.
   我是这样写的: 
   str ='select * from a where t_date >= ';
   str =str + ''''+datetostr( dateTimePicker1.date)+'''';
   tmp_record1 := ADOConnection1.Execute(sel_str);
   但是不对呀
   怎样写才对,谢谢!

解决方案 »

  1.   

    select * from a where t_date between Date1 and Date2
      

  2.   

    str ='select * from a where t_date >= ';
    str =str + '#'+datetostr( dateTimePicker1.date)+'#';
    tmp_record1 := ADOConnection1.Execute(sel_str);
      

  3.   

    access不支持between,得改成> adn <
      

  4.   

    改为以下试试: 
      str ='select * from a where t_date >= ';
       str =str + '#' + datetostr( dateTimePicker1.date) + '#';
      

  5.   

    另外日期字段前后加#
    不明白的地方 看access的帮助。