好好看看datevalue和timevalue函数,有帮助的。

解决方案 »

  1.   

    query.SQL.Add('select * from aa where rq between :rq1 and rq2');
    query.parambyname('rq1').AsDateTime := 日期1;
    query.parambyname('rq2').AsDateTime := 日期2;
      

  2.   

    query.SQL.Add('select * from aa where rq between :rq1 and :rq2');
      

  3.   

    query.SQL.Add('select * from aa where rq between :rq1 and rq2');
    query.parambyname('rq1').AsDateTime := 日期1;
    query.parambyname('rq2').AsDateTime := 日期2; 
      

  4.   

    start_date, end_date
    str := 'select * fro mt1 where fdate between ''' + start_date + ''' and ''' + end_date + '''' ;