strTemp:=strTemp+' and Paydate>='+strtodatetime(dtpTime.DateTime+1)+' and Paydate<='+strtodatetime(dtpTimeend.DateTime+1);
Paydate在ACCESS为YYYY-MM-DD,DTPTIME为tdatetimepicker控件。
[Error] rwnPleaBillQryShow.pas(259): There is no overloaded version of 'StrToDateTime' that can be called with these arguments

解决方案 »

  1.   

    你这是把那两个tdatetimepicker的值传给strTemp然后执行SQL语句吗。
    你不能用strtodatetime的,要转化成字符串的。
    还是用FormatDateTime吧
      

  2.   

    DateTimeToStr FormatDateTime
    寫反了,小夥子。
      

  3.   

    ' and Paydate>=2009-04-02 8:56:56 and Paydate<=2009-12-26 8:57:22'
    大哥这样时间都有了,不需要时间啊
      

  4.   

    用FormatDateTime('yyyy-mm-dd',dtpTime.DateTime),access中日期要加'#'修饰,前后都要加
      

  5.   

    修饰符放在FormatDateTime('yyyy-mm-dd',dtpTime.DateTime)的前面也后面
    '#'+FormatDateTime('yyyy-mm-dd',dtpTime.DateTime+'#'也可以用参数的方法
    with adoquery1 do
    begin
      close;
      sql.text := 'select * from where ....and Paydate>=:paydate1 and Paydate <=paydate2';
      parameters.parambyname('paydate1').value := FormatDateTime('yyyy-mm-dd',dtpTime.DateTime);
      ....
      Open;
    end;