表的时间还是用datetime或者smalldatetime来存储.但是比较查询的时候可以:select *from 表where convert(char(10),日期,120)='1990-09-09'

解决方案 »

  1.   

    select * from 表 where convert(varchar(10),日期字段,120) between convert(varchar(10),@开始时间,120) and convert(varchar(10),@结束时间,120)
      

  2.   

    mschen(发光的星星) :说得是对的我觉得时间数据类型,最好也使用datetime或smalldatetime 
    因为这种数据类型,可以避免输入数据的时候,格式的正确性
    如果使用字符型数据,不能完全保证格式正确。再查询时,再利用convert 或cast将其转换就可以啦
    select convert(char(10),getdate(),120)
      

  3.   

    select *from 表where datediff(day,日期,'1990-09-09')=0