日期:2014-05-18  浏览次数:20505 次

按日期模糊查询检索数据
我想写个按照日期具体到年月然后检索数据,在ms-sql里,
我的日期字段类型smalldatetime类型

是不是这样的写的,select   *   from   where   日期   like   '%2006-12% '

------解决方案--------------------
select * from where convert(char(7),日期,21) like '2006-12 '
------解决方案--------------------
select * from ta where convert(varchar(6),时间列,112)= '200701 '