select * from shijian
---------------------------
sj
2009-12-19 13:50:56.000
2009-12-19 13:51:19.810
2009-12-19 13:51:20.410
2009-12-19 13:51:21.240
2009-12-19 13:51:21.820-----------------------------select * from shijian where sj like '%2009-12-19%'
确没有数据

解决方案 »

  1.   

    日期型数据用你 like '%2009-12-19%' ?
    转换下。
      

  2.   


    select * from shijian where convert(varchar(10),sj,120))='2009-12-19' 
      

  3.   


    --上面多了多括号
    select * from shijian where convert(varchar(10),sj,120)='2009-12-19' 
    --orselect * from shijian where datediff(dd,sj,'2009-12-19')=0
      

  4.   

    --上面多了多括号
    select * from shijian where convert(varchar(10),sj,120)='2009-12-19' 
    --orselect * from shijian where datediff(dd,sj,'2009-12-19')=0