Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "日"
Dim y As Integer = dr("日期").Year
Dim m As Integer = dr("日期").Month
Dim s1 As String = "日期>=#" & m & "/1/" & y & "# And 日期<=#" & dr("日期") & "#"
Dim s2 As String = "日期>=#1/1/" & y & "# And 日期<=#12/31/" & y & "#"
dr("月") = e.DataTable.Compute("Sum(日)",s1)
dr("年") = e.DataTable.Compute("Sum(日)",s2)