日期:2014-05-18 浏览次数:20370 次
create table #t (date1 datetime) insert into #t select getdate() union all select getdate() union all select getdate() --查找这条2007-11-13 12:22:33.717 select * from #t where convert(varchar(10),date1,120)='2007-11-13' and convert(varchar(8),date1,114)='12:22:33' /* date1 ------------------------------------------------------ 2007-11-13 12:22:33.717 (所影响的行数为 1 行) */
------解决方案--------------------
--用秒 select * from [Table] where datediff(s,'2007-11-26 12:14:55',[Date])=0