不再发生不一定就正确,
select * from test where tdate>=to_date('20040606','yyyymmdd');
只有日期的比较,没有具体的时间的比较,如果想比较时间.,则没有时间的部分都将做0
tDate=20040606
select to_char(tDate,'yyyymmdd hh24:mi:ss') from dual;
'20040606 00:00:00'

解决方案 »

  1.   

    tTime既然是传入的时间字符串,数据格式当然就不能是'yyyy/mm/dd',这是省略了时间的日期格式。可以把这个sql打印出来看看就知道正确与否。
      

  2.   

    如果有程序,把出错的SQL语句里的tTime打出来看下是否格式正确。
    select * from test where tdate>=to_date('"+tTime+"','yyyy/mm/dd')
      

  3.   

    select * from test where tdate>=to_date('"+tTime+"')
      

  4.   

    select * from test where tdate>=to_date('xxxx-xx-xx','yyyy-mm-dd')