你放上来的的表,明明就统计出来了啊,不过代码最好加上姓名和日期的判断:
Select Case e.DataCol.name
Case "数量","单产值","计时产值","虚给产值","负产值","姓名","日期"
If e.DataRow.IsNull("姓名")=False AndAlso e.DataRow.IsNull("日期")=False Then
Dim dr As DataRow = DataTables("工资统计表").Find("日期 = #" & e.DataRow("日期") & "# and 员工姓名 = '" & e.DataRow("姓名") & "'")
If dr Is Nothing Then
Dim dr2 As DataRow = DataTables("工资统计表").AddNew
dr2("计件产值")=e.DataTable.Compute("sum(实产值_计件)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr2("计时产值")=e.DataTable.Compute("sum(计时产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr2("需给产值")=e.DataTable.Compute("sum(虚给产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr2("员工姓名")=e.DataRow("姓名")
dr2("总产值")=e.DataTable.Compute("sum(总产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr2("日期")=e.DataRow("日期")
dr2("工资")=e.DataTable.Compute("sum(总产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")*0.06
Else
dr("计件产值")=e.DataTable.Compute("sum(实产值_计件)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr("计时产值")=e.DataTable.Compute("sum(计时产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr("需给产值")=e.DataTable.Compute("sum(虚给产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr("总产值")=e.DataTable.Compute("sum(总产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")
dr("工资")=e.DataTable.Compute("sum(总产值)","日期 = #" & e.DataRow("日期") & "# and 姓名 = '" & e.DataRow("姓名") & "'")*0.06
End If
End If
End Select