If e.DataCol.Name = "姓名" Then
If e.NewValue Is Nothing Then
e.DataRow("计算_借支") = Nothing
Else
Dim Filter1 As String = "[姓名] = '" & e.NewValue & "'"
Dim m1 As Integer = e.DataRow("日期").Month
Dim y1 As Integer = e.DataRow("日期").Year
Dim dt3 As New Date(y1, m1, 1)
Dim dt4 As New Date(y1, m1, Date.DaysInMonth(y1, m1)) '获取本月的最后一天
Filter1 = filter & " and 日期 >= #" & dt3 & "# And 日期 <= #" & dt4 & "#"
e.DataRow("计算_借支") = DataTables("借支表").sqlCompute("Sum(金额)",Filter1)
End If
End If
帮我看看这个代码问题
1、统计不到当月最后一天的金额,其他天的都可以
2、sqlcompute重置列好卡,其他什么方式用起来比较顺手呢,还是说只能加载全部用compute
麻烦您了