我从数据库查询数据
select * from a where ...
and operate_date >= to_date('2008-12-08', 'yyyy-mm-dd')
and operate_date <= to_date('2008-12-15', 'yyyy-mm-dd')
operate_date是Date类型的,但是现在有一个问题,就是operate_date查出的出具都带有时间,例如2008-12-15 10:26:41
这样的话,我想查15日的就查不出来了,因为15日相当于2008-12-15 00:00:00,是最小的
我试着想把SQL语句改成
and to_date(operate_date,'yyyy-mm-dd') >= to_date('2008-12-08', 'yyyy-mm-dd')
and to_date(operate_date,'yyyy-mm-dd') <= to_date('2008-12-15', 'yyyy-mm-dd')
但是报错,ora-01861 文字与格式字符串不匹配
该怎么办啊??