-- 作者:有点甜
-- 发布时间:2018/3/16 14:17:00
--
分别统计各个值 【员工离职率=某一时间段某一群体当月离职人数/(某段时间某一群体最初在职人数+此期间新进人数)×100%】
当月的条件这样写
Dim d As Date = Date.Today
d = New Date(d.year, d.month, 1)
Dim Filter As String = "日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#"
当月离职数,如
Dim d As Date = Date.Today
d = New Date(d.year, d.month, 1)
Dim Filter As String = "离职时间 >= #" & d & "# and 离职时间 < #" & d.AddMonths(1) & "#"
Dim Count = DataTables("表A").Compute("count(姓名)", filter)
月初在职数,如
Dim d As Date = Date.Today
d = New Date(d.year, d.month, 1)
Dim Filter As String = "离职时间 is null and 入职时间 < #" & d & "#"
Dim Count = DataTables("表A").Compute("count(姓名)", filter)
本月新增数,如
Dim d As Date = Date.Today
d = New Date(d.year, d.month, 1)
Dim Filter As String = "入职时间 >= #" & d & "# and 入职时间 < #" & d.AddMonths(1) & "#"
Dim Count = DataTables("表A").Compute("count(姓名)", filter)
|