select * from table 
 where to_char(to_date(estimate_date,'yyyy-mm-dd')-7,'yyyy-mm-dd')<='2000-01-01'
 and to_char(to_date(estimate_date,'yyyy-mm-dd')+7,'yyyy-mm-dd')>='2000-01-01'

解决方案 »

  1.   

    select * from table 
    where 
    estimate_date between to_date('2004-01-01','yyyy-mm-dd')-14 and to_date('2004-01-01','yyyy-mm-dd')+14 
    or actual_date between to_date('2004-01-01','yyyy-mm-dd')-14 and to_date('2004-01-01','yyyy-mm-dd')+14
      

  2.   

    谢谢各位。以dinya2003(OK)的解法为例,如果我还有一些别的条件,是不是应该写成:
    select * from table
    where
    (conditions
    and
    estimate_date between to_date('2004-01-01','yyyy-mm-dd')-14 and to_date('2004-01-01','yyyy-mm-dd')+14)
    or
    (conditions
    and
    actual_date between to_date('2004-01-01','yyyy-mm-dd')-14 and to_date('2004-01-01','yyyy-mm-dd')+14)?
      

  3.   

    to: wupangzi(无本之木)
    只要说一些建设性的东西就会有分的啊,呵呵~~~
    :-)
      

  4.   

    也可以这样
    select  *  from  table  
    where  
    (conditions  
    and  
    estimate_date - to_date('2004-01-01','yyyy-mm-dd') between -14  and 14)  
    or  
    (conditions  
    and  
    actual_date - to_date('2004-01-01','yyyy-mm-dd') between -14 and 14)
      

  5.   

    来论坛更多的是互相学习,交流.    :)支持  ks9960(snk)  兄.
      

  6.   

    where urcondition and (estimate_date_condition or actual_date_condition)