WHERE 选择日期 between '2000-01-01' and '2002-12-31'orWHERE datepart(year,选择日期) = 2000 or datepart(year,选择日期) = 2001 or datepart(year,选择日期) = 2002

解决方案 »

  1.   

    select 日期字段 from 表 where year(日期字段) in(2000,2001,2002)select 日期字段 from 表 where 日期字段>'2000-01-01' and 日期字段<'2002-12-31 24:00:00'select 日期字段 from 表 where 日期字段 between'2000-01-01' and '2002-12-31 24:00:00'
      

  2.   


    select * from table1 where datepart(year,选择日期) >= 2000 
    and datepart(year,选择日期) <= 2002