在SqlServer中可以用datediff函数来判断。。
在oracle中怎么判断啊
select * from tb_CaculateFlow where datediff(day,updateTime,getdate())=0;
这是在SqlServer中判断。。updateTime为时间字段
oracle中我是下面这样写的。有错误
select * from tb_caculateflow where TRUNC(to_date(sysdate,'yyyy-mm-dd')-to_date(updateTime,'yyyy-mm-dd'))=0;
请帮我看看~~

解决方案 »

  1.   


    试试:select * from tb_caculateflow where to_date(sysdate,'YYYY-MM-DAY')=to_date(updateTime,'YYYY-MM-DAY')------------------------------------------------------------------------------
    Blog: http://blog.csdn.net/tianlesoftware
    网上资源: http://tianlesoftware.download.csdn.net
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
    Q Q 群:62697716 
      

  2.   

    select * from tb_caculateflow where TRUNC(sysdate)=TRUNC(updateTime); 
      

  3.   


    更正:
    select * from tb_caculateflow where to_date(sysdate,'YYYY-MM-DD')=to_date(updateTime,'YYYY-MM-DD')------------------------------------------------------------------------------
    Blog: http://blog.csdn.net/tianlesoftware
    网上资源: http://tianlesoftware.download.csdn.net
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
    Q Q 群:62697716 
      

  4.   

    select * from tb_caculateflow where to_char(sysdate,'yyyy-mm-dd')=to_char(updateTime,'yyyy-mm-dd'))
      

  5.   

    select * from tb_caculateflow where TRUNC(sysdate)-TRUNC(updateTime)=0; or select * from tb_caculateflow where TRUNC(sysdate)=TRUNC(updateTime); orselect * from tb_caculateflow where to_char(sysdate,'YYYY-MM-DD')=to_char(updateTime,'YYYY-MM-DD'); 
      

  6.   

    hi
    you can try this:select * from tb_calateflow a where to_date(sysdate,'YYYY-MM-DD')=to_date(a.updatetime,'YYYY-MM-DD')
      

  7.   

    首先谢谢各位的帮忙。。 用各位的sql语句在pl/sql中都能正确的查询出来。。
    可是放在asp.net中作为一个sql语句的时候就报错了
    错误类型是:ORA-01861: 文字与格式字符串不匹配
      

  8.   

    ORA-01861 literal does not match format stringCause: Literals in the input must be the same length as literals in the format string (with the exception of leading white space). If the "FX" modifier has been toggled on, the literal must match exactly, with no extra white space.Action: Correct the format string to match the literal.--就是字符串格式不正确!!
      

  9.   

    解决。。谢谢各位。。
    ojuju10   cxbao123  da21正解