select * from tablename where convert(char(7),datecol,120)='2004-10'

解决方案 »

  1.   

    select * from tablename where convert(char(7),datecol,120)<='2004-10'
      

  2.   

    Select * from 表 Where DateDiff(d,'2004-10-01',字段)>0
      

  3.   

    select * from tablename where datediff(m,datecol,'2004-10-1')<=0
      

  4.   

    这样也可以Select * from 表 Where Convert(varchar(7),字段,120)>='2004-10'
      

  5.   

    select * from tablename where convert(char(7),datecol,120>='2004-10-01'
      

  6.   

    select * from tablename where (cast(year(Datatime) as varchar)+
    +'-'+cast(month(Datatime) as varchar))='2004-10'