Are you sure the two values are exactly the same?
As written there appears to be a slight mistake in the inner iif
statement, but that doesn't explain the results you're currently getting.
Pseudocode helps me understand how these expressions work:
if q3 = q4
"none"
else*
if q3 > q4
"up"
else*
"down"
*note that else
is implied; not legal syntax here
Making as few changes as possible, this should work as you expect it to:
trend: IIf([qryQuarterlyCustomersales3rdQuarter_final]
.[3rd qrtr sls] = [qryQuarterlyCustomersales4thQuarter_final]
.[4th qrtr sls],"none",
IIf([qryQuarterlyCustomersales3rdQuarter_final]
.[3rd qrtr sls] > [qryQuarterlyCustomersales4thQuarter_final]
.[4th qrtr sls],"up","down")) # <- these final two args should be switched
Documentation:
Syntax
IIf(expr, truepart, falsepart)
The IIf function syntax has these
arguments:
ARGUMENT DESCRIPTION expr Required.
Expression you want to evaluate.
truepart Required. Value or expression
returned if expr is True.
falsepart Required. Value or
expression returned if expr is False.