zimmer9
asked on
How would you write the following Access query statement in pseudocode - IIf([SL]="L",IIf([Direction]="Credit","D","C"),IIf(Direction="Credit","A","B")) AS T ?
How would you read this full statement in pseudocode from an Access application?
IIf([SL]="L",IIf([Directio n]="Credit ","D","C") ,IIf(Direc tion="Cred it","A","B ")) AS T
IIf([SL]="L",IIf([Directio
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Scott really should have gotten that credit, I simply pointed out a typo.
ASKER
How would I modify my answer.
Your statement should be:
IIf([SL]="L",IIf([Directio n]="Credit ","D","C") ,"B")) AS T
IF SL = "L"
IF Direction = "Credit"
"D"
ELSE
"C"
END IF
ELSE
"B"
END IF
IIf([SL]="L",IIf([Directio
IF SL = "L"
IF Direction = "Credit"
"D"
ELSE
"C"
END IF
ELSE
"B"
END IF
@hnasr,
Your suggestion omits one of the options.
There are two conditions, each with two outcomes so you should have four possible results. Your recast expression has only three.
Your suggestion omits one of the options.
There are two conditions, each with two outcomes so you should have four possible results. Your recast expression has only three.
IF SL = "L"
IF Direction = "Credit"
"D"
ELSE
"C"
END IF
ELSE
IF Direction = "Credit"
"A"
ELSE
"B"
END IF
END IF
Check the value of [SL].
If it the value of [SL] equals "L", then check the value of [Direction]. If the value of [Direction] equals "Credit" then return "D".
If it does not equal "Credit" then return a
"C"
If the value of [SL] does not equal "L", then check the value of [Direction]. If the value of [Direction] equals "Credit" then return "A". If it does not equal "Credit" then return "B"