大家好,请帮帮忙啊,我想问个问题。有个表里面有个DATE类型的属性Indate,怎样判断Indate=系统当前的时间啊?  例如2007-06-05

解决方案 »

  1.   

    where to_char(Indate,'yyyy-mm-dd') =to_char(sysdate,'yyyy-mm-dd') 精确到日
      

  2.   

    谢谢啊,可是不行啊
    提示信息MySQL 返回: #1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '( Indate , 'yyyy-mm-dd' ) = to_char ( sysdate , 'yyyy-mm-dd' ) 
      

  3.   

    晕 我以为你是 oracle,msql可能语法有些区别大体差不多啦
      

  4.   

    current_time得到的是当前时间,不是日期.
    用CURDATE()得到当前日期,2007-6-6
      

  5.   

    MYSQL提供了至少3个时间函数,其中 now()精确到秒,不适用用curtime() ,返回值就是精确到日的,和DATE型搭配
      

  6.   

    @AudDate=convert(nvarchar(10),getdate(),120)