If e.DataCol.Name = "当月入库数" OrElse e.DataCol.name = "收发数量" OrElse e.DataCol.name = "收发日期" Then If e.DataRow.Isnull("收发日期") Then e.DataRow("当月入库数") = Nothing Else Dim d As Date = e.DataRow("收发日期") e.DataRow("当月入库数") = DataTables("某表").Compute("sum(收发数量)", "收发日期 >= #" & d & "# and 收发日期 < #" & d.AddMonths(1) & "#") End If End If