select year(getdate()),month(getdate()

解决方案 »

  1.   

    少了')'
    select year(getdate()),month(getdate())
      

  2.   

    MONTH
    返回代表指定日期月份的整数。语法
    MONTH ( date )YEAR
    返回表示指定日期中的年份的整数。语法
    YEAR ( date )
      

  3.   

    select year(字段),month(字段) from mytable
      

  4.   

    select year(getdate()),month(getdate())
                            
    ----------- ----------- 
    2004        1(所影响的行数为 1 行)
      

  5.   

    谢谢猴子,我猴年就本命年了,真是惭愧!
    thank your two.