select * from t1 where cast(时间 as datetime) between '2002-3-3' and '2003-5-5'

解决方案 »

  1.   

    select * from t1 where datediff(day,时间,'2002-3-3')<=0 and datediff(day,时间,'2003-5-5')>=0
      

  2.   

    select * from t1 where 时间>='2002-3-3' and 时间<='2003-5-5'
      

  3.   

    在一个表里有一个列是时间变量(year-day-month)这个列是什么类型?两种方法应该都可以实现。
      

  4.   

    你的日期格式真是怪.用下面的方法应该可以了:select * from t1 where convert(datetime,right(时间,5)+'-'+left(时间,4),105) between '2002-3-3' and '2003-5-5'
      

  5.   

    注意,你的时间格式在确保是:year-day-month如果还不行,就用:
    select * from t1 where convert(varchar(10),convert(datetime,right(时间,5)+'-'+left(时间,4),105),120) between '2002-03-03' and '2003-05-05'
      

  6.   

    啊,不好意思,偶把day和month弄翻了。