老师您好,下面的代码,标注颜色部分,为什么第一段代码使用SQLFind可以查找到信息,但是第二段代码不能使用SQLFind,只能使用Find?和要查询的表有关系么?第二个表是建立的查询表。
If e.DataCol.name = "人员"
If e.DataRow("人员") IsNot Nothing Then
'在员工档案系统查找人员对应的机构 部门 岗位 岗位状态信息并填入提成表
Dim dr As DataRow
With DataTables("员工档案系统")
dr = .SQLfind("姓名 = '" & e.DataRow("人员") & "' And 一级部门 = '客户服务部'")
End With
If dr IsNot Nothing Then
e.DataRow("机构") = dr("分支机构")
e.DataRow("部门") = dr("一级部门")
e.DataRow("岗位") = dr("岗位")
e.DataRow("岗位状态") = dr("岗位状态")
End If
'在TP续签率报表中查找续签率并填入提成核算表
Dim dr2 As DataRow
With DataTables("TP续签率日报查询表")
dr2 = .find("客服组织_客服组员 = '" & e.DataRow("人员") & "'") '如果使用SQL语句则查不到续签率
End With
If dr2 IsNot Nothing Then
e.DataRow("提成汇总_续签率") = dr2("统计截止日分子分母及续签率_续签率")
End If
End If
End If