|
请高手帮忙看一下
Dim str, str1, str2 As String
Dim rs, rs1 As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs1 = New ADODB.Recordset
str = "select * from 工资总表 where 工号"
str1 = "select * from 奖励系数"
rs.Open str, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rs1.Open str1, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do Until rs.EOF
If rs("总出勤") = 0 Or rs("总工分") = 0 Or IsNull(rs("公司类别")) Or rs("级别分") = 0 Then
rs("奖励系数") = 0
Else
Do Until rs1.EOF
If rs("公司类别") = rs1("公司类别") Then
If rs("出勤类别") = "一类正常" And rs("总工分") >= rs1("开始") And rs("总工分") < rs1("结束") Then
rs("奖励系数") = rs1("调整系数")
GoTo tingzhi
End If
If rs("出勤类别") = "一类特殊" And rs("总工分") / rs("总出勤") * 345 >= rs1("开始") And rs("总工分") / rs("总出勤") * 345 < rs1("结束") Then
rs("奖励系数") = rs1("调整系数")
GoTo tingzhi
End If
End If
rs1.MoveNext
Loop
End If
tingzhi:
rs1.MoveFirst
rs.MoveNext
Loop
记录大概有15000条,如果分两段计算可以通过,不过放在一起就不可以了,请高手指点 |
|