有好多列 请问下需要这样罗列出来么 如果有200列都要这样写上去么=。= 不知道有没有简化的方法或者可以提高速度的方法(数据多了以后会卡)先谢谢啦
Select Case e.DataCol.Name
Case "岗位工资","综合补贴","考核工资","计件工资","补贴","房贴","加班费","国定假加班费","值班费","托底","津贴","高温费","奖金","饭贴","劳防用品","补发本年度","补发上年度","其他","半年奖","年终奖","上年年终奖","特别奖励","工伤","垫付","离职补偿","病假扣款","事假扣款","转正入离职扣款","产假停发"
If e.DataRow.IsNull("身份证") Then
e.DataRow("应发合计") = Nothing
Else
e.DataRow("应发合计") = e.DataRow("岗位工资")+e.DataRow("综合补贴")+e.DataRow("考核工资")+e.DataRow("计件工资")+e.DataRow("补贴")+e.DataRow("房贴")+e.DataRow("加班费")+e.DataRow("国定假加班费")+e.DataRow("值班费")+e.DataRow("托底")+e.DataRow("津贴")+e.DataRow("高温费")+e.DataRow("奖金")+e.DataRow("饭贴")+e.DataRow("劳防用品")+e.DataRow("补发本年度")+e.DataRow("补发上年度")+e.DataRow("其他")+e.DataRow("半年奖")+e.DataRow("年终奖")+e.DataRow("上年年终奖")+e.DataRow("特别奖励")+e.DataRow("工伤")+e.DataRow("垫付")+e.DataRow("离职补偿")-e.DataRow("病假扣款")-e.DataRow("事假扣款")-e.DataRow("转正入离职扣款")-e.DataRow("产假停发")
End If
Dim dr2 As DataRow = e.DataTable.Find("[_SortKey] < " & dr("_SortKey") & " And [单位] = '" & dr("单位") & "' And [身份证] = '" & dr("身份证") & "' And [日期] = #" & dr("日期") & "# ", "[_SortKey] Desc")
If e.DataRow.IsNull("身份证") Then
e.DataRow("累计应发工资") = Nothing
dr2 = e.DataRow
ElseIf dr2 IsNot Nothing Then
dr("累计应发工资") = e.DataTable.Compute("Sum(应发合计)"," [单位] = '" & dr("单位") & "' And [身份证] = '" & dr("身份证") & "' and [日期] <= #" & dr("日期") & "# ")
dr2 = e.DataRow
Else
dr("累计应发工资") = e.DataTable.Compute("Sum(应发合计)"," [单位] = '" & dr("单位") & "' And [身份证] = '" & dr("身份证") & "' and [日期] <= #" & dr("日期") & "# ")
dr2 = e.DataRow
End If
End Select
[此贴子已经被作者于2021/11/23 17:16:54编辑过]