案例中的代码为:If e.DataCol.name = "年份" OrElse e.DataCol.name = "操作人" Then
If e.DataRow.Isnull("年份") = False AndAlso e.DataRow.Isnull("操作人") = False Then
Dim filter As String = "姓名 = '" & e.DataRow("操作人") & "'"
For i As Integer = 1 To 12
Dim d As Date = new Date(val(e.DataRow("年份")), i, 1)
Dim sum As Integer = DataTables("表A").compute("sum(成交额)", filter & " and 成单日期 >= #" & d & "# and 成单日期 < #" & d.addmonths(1) & "#")
e.DataRow("M" & i) = sum
Next
Else
For i As Integer = 1 To 12
e.DataRow("M" & i) = Nothing
Next
End If
End If
我想达到这样,
Dim filter As String = 如果“部门”为"设计部"则"姓名 = '" & e.DataRow("操作人") & "'" ,如果“部门”为"业务员"则"业务员 = '" & e.DataRow("操作人") & "'"
不知可否实现,求解?