这段这样不知行不行?
Else Dim dt As DataTable = DataTables("收入") Dim dr As DataRow = e.DataRow Dim str As String = "[业务分块]='公有部分' And [年度] = '" & dr("年度") & "'And [月份]" dr("月1") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 1")/(250000 - dt.Compute("Sum(实收费额)",str & "< 1")) dr("月2") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 2")/(250000 - dt.Compute("Sum(实收费额)",str & "< 2")) dr("月3") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 3")/(250000 - dt.Compute("Sum(实收费额)",str & "< 3")) dr("月4") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 4")/(250000 - dt.Compute("Sum(实收费额)",str & "< 4")) dr("月5") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 5")/(250000 - dt.Compute("Sum(实收费额)",str & "< 5")) dr("月6") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 6")/(250000 - dt.Compute("Sum(实收费额)",str & "< 6")) dr("月7") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 7")/(250000 - dt.Compute("Sum(实收费额)",str & "< 7")) dr("月8") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 8")/(250000 - dt.Compute("Sum(实收费额)",str & "< 8")) dr("月9") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 9")/(250000 - dt.Compute("Sum(实收费额)",str & "< 9")) dr("月10") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 10")/(250000 - dt.Compute("Sum(实收费额)",str & "< 10")) dr("月11") = dr("实报金额")*dt.Compute("Sum(实收费额)",str & "= 11")/(250000 - dt.Compute("Sum(实收费额)",str & "< 11")) dr("月12")=dr("实报金额")-dr("月1")-dr("月2")-dr("月3")-dr("月4")-dr("月5")-dr("月6")-dr("月7")-dr("月8")-dr("月9")-dr("月10")-dr("月11") End If
|