日期:2014-05-18 浏览次数:20564 次
select * from A where date between +@ymd + ' 00:00:00' and @ymd +' 23:59:59'
------解决方案--------------------
select * from A where Dates between @ymd+' 00:00:00' and @ymd +' 23:59:59' or create proc p_test @ymd varchar(12) as declare @sql varchar(max),@sql2 varchar(max) set @sql=' select * from A where date between '''+@ymd + ' 00:00:00'''+'and ''' +@ymd +' 23:59:59''' print @sql---select * from A where date between '2012-04-18 00:00:00'and '2012-04-18 23:59:59'