Office中国论坛/Access中国论坛
标题:
请教高手:max等,.......怎么解决?
[打印本页]
作者:
liunvshi
时间:
2004-8-5 17:43
标题:
请教高手:max等,.......怎么解决?
请教高手:
max,min not等说我没有引用.......怎么解决?
Option Compare Database
Option Explicit
Public Function HNTQD(hntky1 As Double, hntky2 As Double, hntky3 As Double) As Double
Dim hntpj As Double
Dim hntmax As Double
Dim hntmin As Double
Dim hntzjz As Double
Dim qd41 As Double
Dim qd42 As Double
Dim qd43 As Double
qd41 = hntky1
qd42 = hntky2
qd43 = hntky3
hntmax = Max(qd41, qd42, qd43)
hntmin = Min(qd41, qd42, qd43)
hntpj = Avg(qd41, qd42, qd43)
hntzjz = Not (hntmax) And Not (hntmin)
If (hntmax - hntzjz) / hntzjz > 0.15 And (hntzjz - hntmin) / hntzjz > 0.15 Then
HNTQD = "作废"
ElseIf (hntmax - hntzjz) / hntzjz > 0.15 Or (hntzjz - hntmin) / hntzjz > 0.15 Then
HNTQD = hntzjz
ElseIf (hntmax - hntzjz) / hntzjz < 0.15 Or (hntzjz - hntmin) / hntzjz < 0.15 Then
HNTQD = hntpj
End If
End If
End If
End Function
作者:
swo
时间:
2004-8-5 18:28
max只能用于查询中,不能像你这样用来对数据进行比较。
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3