办法比较笨,但可行:
select to_date(to_char(sysdate)) from dual
where (to_date(to_char(sysdate))-to_date(to_char(sysdate)))=0

解决方案 »

  1.   

    date1和date2能确定是几位长吗?
    4?
    6?
    8? 
    .....
      

  2.   

    实在不行就
    select  *  from  tb  
    where  to_char(operate_date,'yyyymmdd')  between  :date1  and  :date2  ;  
    参数类型为字符串,格式类似于'20040912'
     
      

  3.   

    select  *  from  tb  
    where  operate_date  
    between  to_date(:date1,'yyyymmdd')  and  to_date(:date2,'yyyymmdd');  参数类型为字符串,格式类似于'20040912'
      

  4.   

    select *
    from table_anme
    where operate_date >=to_date(:date1,'dd-mm-yyyy') and operate_date <=to_date(:date2,'dd-mm-yyyy')
      

  5.   

    SELECT * FROM TABLE_NAME WHERE operate_date between to_date(:date1,'yyyymmdd') and to_date(:date2,'yyyymmdd');不行吗?