Dim dt As DataTable = DataTables("retable") For Each dr As DataRow in dt.DataRows Dim pr As DataRow = dr.GetParentrow("totaltable") pr("加班累计用时") = dt.Compute("Sum(工作用时)", "报告人 = '" & dr("报告人") & "' and 加班 = false ") pr("正班累计用时") = dt.Compute("Sum(工作用时)", "报告人 = '" & dr("报告人") & "' and 加班 = true ") Next