这个意思?
Select Case e.DataCol.Name
Case "日期","员工"
If e.DataRow.IsNull("日期") Then
e.DataRow("计数") = Nothing
Else
Dim max As String '最大编号
Dim idx As Integer
Dim rq As String = e.DataRow("日期")
Dim yg As String = e.DataRow("员工")
max = e.DataTable.Compute("Max(计数)","日期 = '"& rq &"' And 员工 = '"& yg &"' And [_Identify] <> " & e.DataRow("_Identify")) '取得最大计数
If max > "" Then '如果存在最大计数
idx = CInt(max) + 1 '获得最大计数,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("计数") = idx
End If
Case "工时"
For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
Dim Val1 As Double = e.DataTable.Compute("Sum(工时)","[_SortKey] <= " & e.DataRow("_SortKey") & " and 员工 = '" & e.DataRow("员工") & "'")
dr("累计工时") = Val1
Next
End Select
http://www.foxtable.com/help/topics/1572.htm
http://www.foxtable.com/help/topics/2136.htm