select b.code 工號,b.cnname 中文名,sum(QuartersHours/60) 總工時
from AttendanceRollcall as a ,employee as b
where a.date >= (SELECT DATEADD(week, DATEDIFF(week, '', getdate()), -1))
and a.date <= (SELECT DATEADD(week, DATEDIFF(week, '', getdate()), 5))
and a.employeeid=b.employeeid
and attendancetypeid='R137116f301e133a094958aa5b6c430923b0ef'
group by b.cnname,AttendanceTypeId,b.code
having sum(QuartersHours/60) > 40;

arrow
arrow
    全站熱搜

    vernal9 發表在 痞客邦 留言(0) 人氣()