If Condition Not Giving Proper Result (1 Viewer)

vagues0ul

Registered User.
Local time
Today, 03:38
Joined
Sep 13, 2018
Messages
103
I am using if condition on an unbounded textbox to display some value according to certain criteria. But its only validating the first statement. I know there will be some logical error that is driving the wrong result.

here is the statement
Code:
=IIf([fmttl]/[fmmttl]*100 >"90","A+", IIf([fmttl]/[fmmttl]*100 >="80","A", IIf([fmttl]/[fmmttl]*100 >="70","B", ,"Fail")))

when it executes, it display A+ for every field. i assume that there is some error in the >= expression :confused:
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:38
Joined
May 7, 2009
Messages
19,234
remove the double quote on 90, 80, 70, etc...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:38
Joined
May 7, 2009
Messages
19,234
Switch([fmttl]/[fmmttl]*100 >90, "A+",[fmttl]/[fmmttl]*100 >=80, "A", [fmttl]/[fmmttl]*100 >=70,"B", True,"Fail")
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:38
Joined
May 7, 2009
Messages
19,234
yes and its very straigh forward.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:38
Joined
Feb 19, 2002
Messages
43,263
What may not be clear from the answer is that numeric values are NOT supposed to be enclosed in quotes. The Switch is easier to work with if you have to add additional calculations but what you had would have worked without the quotes.

Strings - enclose in single or double quotes - 'abc' or "def"
Dates - enclose in # - #9/29/18#
Numbers - nothing - 45 or 38.76 or -299999.4563
 

Users who are viewing this thread

Top Bottom