那么考勤表中有没有表名是早上上班打卡,晚上下班打卡的字段,如果有可以select * from tb where convert(varchar(6),addtime,112) = '201412' and [打卡类型] = '早班上班打卡' and datediff(dd,convert(datetime,convert(varchar(10),addtime,120)+' 08:00'),addtime) > 10
select * from talbe where DATEPART ( MONTH , addtime)=12 and Convert(varchar(8),addtime,108)>'08:10:00'
from tb
where convert(varchar(6),addtime,112) = '201412'
and [打卡类型] = '早班上班打卡'
and datediff(dd,convert(datetime,convert(varchar(10),addtime,120)+' 08:00'),addtime) > 10
select * from talbe
where DATEPART ( MONTH , addtime)=12
and Convert(varchar(8),addtime,108)>'08:10:00'