If e.DataCol.Name = "项目编号" OrElse e.DataCol.name = "岗位层级" Then '发生变化的是"项目编号"列.
e.DataRow("中层任务因子_小计") = Nothing
e.DataRow("高管任务因子_小计") = Nothing
e.DataRow("基层任务因子_小计") = Nothing
If e.DataRow("岗位层级") = "高层正职" OrElse e.DataRow("岗位层级") = "高层副职" Then
e.DataRow("高管任务因子_小计") = DataTables("个人明细").SQLCompute("Sum(任务_计量)","[项目编号] = '" & e.datarow("项目编号") & "'and 岗位层级 Like '%高层%'")
ElseIf e.DataRow("岗位层级") = "中层正职" OrElse e.DataRow("岗位层级") = "中层副职" Then
e.DataRow("中层任务因子_小计") = DataTables("个人明细").SQLCompute("Sum(任务_计量)","[项目编号] = '" & e.datarow("项目编号") & "'and 岗位层级 Like '%中层%'")
ElseIf e.DataRow("岗位层级") = "基层人员" Then
e.DataRow("基层任务因子_小计") = DataTables("个人明细").SQLCompute("Sum(任务_计量)","[项目编号] = '" & e.datarow("项目编号") & "'and 岗位层级 Like '%基层%'")
End If
End If
[此贴子已经被作者于2017/6/13 10:23:18编辑过]