当然不对在 MS SQL Server 中.

解决方案 »

  1.   

    sysdate是系统变量而非字段变量或表达式
      

  2.   

    不对。左边已经定义了日期格式就不用再用trunc了。最好用日期段来。select * from bbb
    where tran_date>=to_date('2001-10-5','yyyy-mm-d') and tran_date<to_date('2001-10-5','yyyy-mm-d')+1;
      

  3.   

    select week from bbb where trunc(jobdate) = trunc(to_date('2001-10-9','yyyy-mm-dd'))jobdate是bbb中的一个字段
    对吗?
    另外  TRUNC(sysdate)出来的格式是什么呀?
      

  4.   

    select week from bbb where trunc(jobdate) = to_date('2001-10-9','yyyy-mm-dd')
    就行了
      

  5.   

    当然是一个字段,你不会想用sysdate当字段吧?已经用了to_date,为什么还要用trunc呢?
    SQL> select trunc(sysdate) from dual;可以看看书嘛。TRUNC(SYSDATE)
    ------------------
    08-OCT-01