老师,我想添加最大月份这个条件,添加进去之后提示如下异常,请帮忙看看,谢谢
Dim dr8 As Integer = DataTables("期初数据").SQLCompute("max(月)", Filter5)
Select Case e.DataCol.Name
Case "材料编码"
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
If dr.IsNull("材料编码") Then
dr("上月结存") = 0
Else
Dim filter As String
filter = "成品编码= '" & dr("材料编码") & "' and 库位 = '设备备件' and 月 = '" & dr8 & "'"
pr = DataTables("期初数据").SQLFind(filter)
If pr IsNot Nothing Then
dr("上月结存") = pr("期初数量")
End If
End If
End Select
此主题相关图片如下:1.jpg