Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim dr As DataRow = e.DataRow
Dim dt As DataTable = DataTables("销售资料")
If e.DataCol.Name = "管辖部门" Then
dr("销售数量") = dt.Compute("Sum(数量)", "[管辖部门] = '" & dr("管辖部门") & "'")
End If
老师我想在开piao月份输入4,,把销售资料的4月份的数量统计出来,,不管几号的是4月份的都统计出来,需要怎么做呀
现在就是不会分月统计麻烦指教一下
是2个表的,,,是不是[开piao月份]='"销售日期 >= #" & dt1 & "# And 销售日期 <= #" & dt2 & "#"
dim m as string = "4" 这个是不是意思就统计4月份,,开piao月份输入是5月份是不是不可以的
dim m as string = e.datarow 这里是不是要这样才有用的啊
Dim dr As DataRow = e.DataRow
Dim dt As DataTable = DataTables("销售资料")
'If e.DataCol.Name = "管辖部门" Then
'dr("销售数量") = dt.Compute("Sum(数量)", "[管辖部门] = '" & dr("管辖部门") & "'")
'End If
Dim m As String = e.DataRow("开piao月份")
Dim y As Integer = Date.Today.Year
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim Filter As String = "[管辖部门] = '" & dr("管辖部门") & "' and 销售日期 >= #" & dt1 & "# And 销售日期 <= #" & dt2 & "#"
dr("销售数量") = dt.Compute("Sum(数量)", Filter)
谢谢老师,,可以实现了