日期:2014-05-17 浏览次数:20662 次
select * from punc_oridata where personcode='C00612' and convert(varchar(10),ptime,108) between '18:00:00' and '23:59:59';
------解决方案--------------------
select * from punc_oridata where personcode='C00612' and ptime>='2012-09-19 18:00:00' and ptime<'2012-09-20 00:00:00'
------解决方案--------------------
select * from punc_oridata where personcode='C00612' and datediff(hh,convert(varchar(10),ptime,120),ptime)>=18
------解决方案--------------------
这个是获取小时加分钟:SELECT CONVERT(VARCHAR(2),DATEPART(hh,'2012-09-19 18:00:00.000'))+':'+CONVERT(VARCHAR(2),DATEPART(n,'2012-09-19 18:00:00.000'))