Select Case e.DataCol.name Case "计量期数","是否是退成本差额","本期统计成本fa piao","项目编码" If e.DataRow("是否是退成本差额") = True Then Dim dr As DataRow dr = DataTables("表A").Find("[计量期数] < '" & e.DataRow("计量期数") & "' And [项目编码] = '" & e.DataRow("项目编码") & "'", "[计量期数] Desc") If dr IsNot Nothing Then e.DataRow("本期需要成本fa piao") = iif(e.DataRow("本期统计成本fa piao")>=dr("成本差额"),e.DataRow("本期统计成本fa piao"),dr("成本差额")) End If End If End Select
|