34,590
社区成员
发帖
与我相关
我的任务
分享
insert #test
select a.kkg,a.ksj,datediff(mi,a.rq,a.sd)-datediff(mi,0,a.yd) as d,
datediff(mi,0,yt)-datediff(mi,a.rq,a.st) + case when a.blb = 3 then 1440 else 0 end as t
from 考勤表 a
where a.ny = @ny and a.sd is not null and a.kzz = 0
update b
set b.kkg = case when b.d>=240 and b.t>=240 then 1 else 0 end ,
b.ksj = case when (b.d>15 and b.d< 240) and (b.t>15 and b.t <240) then 0.75 else 0 end
from #test