delphi的日期型与oracle有所不同,通过一个函数转换
formatdate(..)  --像是这个函数

解决方案 »

  1.   

    需要转换数据类型。
    比如:
    to_char(DateField,'yyyy-mm-dd')将日期格式转换为字符串返回to_date('2004-4-21','yyyy-mm-dd')将字符串转换为日期格式所以
    sql.add('select * from kcoutk where salesdate between to_date(:start1,''yyyy-mm-dd'') and to_date(:end1,''yyyy-mm-dd'')');Parameters.ParamByName('start1').Value:=DateToStr(dtpstart.Date);
    Parameters.ParamByName('end1').Value:=DateToStr(dtpend.Date);测试成功!
    msn:[email protected]
      

  2.   

    Parameters.ParamByName('start1').AsDateTime:=dtpstart.Date;
    Parameters.ParamByName('end1').AsDateTime:=dtpend.Date;???????????????????可以么
      

  3.   

    sql.add('select * from kcoutk where salesdate between to_date(:start1,''YYYY-MM-DD'') and to_date(:end1,''YYYY-MM-DD'')');