参考代码
If e.DataCol.Name = "客户_客户编码" Then Dim d1 As Date = new Date(Date.today.Year, 1, 1) Dim d2 As Date = d1.AddYears(1)
e.DataRow("本年发货额") = DataTables("发货明细表").Compute("Sum("发货金额")", "发货时间 >= #" & d1 & "# and 发货时间 < #" & d2 & "# and [客户_客户编码] = '" & e.NewValue & "'"")
End If
http://www.foxtable.com/webhelp/scr/2720.htm