IFF

S

Steve

how would i pput in a statement to show if something equaled 100% = Pass, and
anything under = fail?

I was tring something like this but it doesnt work, sorry, i am just finding
my way around access!

=IIf([overall]="100","Pass","Fail")

Thanks for your help!
 
R

RonaldoOneNil

Assuming [overall] is a calculated control on your form and is therefore
numeric, then the control source of your 'statement' control should be
=IIf([overall]=100,"Pass","Fail")

Tip for future posts for help: Please be more specific about what is going
wrong rather than just stating 'it doesn't work'
 
R

Rick Brandt

Steve said:
how would i pput in a statement to show if something equaled 100% =
Pass, and anything under = fail?

I was tring something like this but it doesnt work, sorry, i am just
finding my way around access!

=IIf([overall]="100","Pass","Fail")

Thanks for your help!

What DataType is [overall]? What you have should work if it were Text. If
it's an integer use...

=IIf([overall] = 100, "Pass", "Fail")

If it's a percentage use...

=IIf([overall] = 1,"Pass","Fail")

To account for rounding in the formatted display you might need to use
something like...

=IIf([overall] > 0.99, "Pass", "Fail")
 
R

Rob Parker

Hi Steve,

Glad I'm not doing a course in your institution - a pass mark of 100% is
setting the bar awfully high ;-)

But to your problem:

If [overall] is a numeric field (and it certainly should be, if you are
trying to do value comparisons on it), you should not enclose the value you
are testing for in " delimiters; that will try to match a string containing
the characters "100". Further, if [overall] is a numeric field containing a
single or double precision value, which is being formatted to display as a
percentage in a control, then the value of 100% will actually be represented
by a value of 1.0000000. And lastly, if you are testing for a boundary
condition (ie. values below are fail, values equal to or above are a pass),
then you should use a >= test, rather than just an = test.

So, one of the following should probably work:
=IIf([overall] >=1.0,"Pass","Fail") - if the value is a number displayed
as a percentage
or
=IIf([overall] >=100,"Pass","Fail") - if the value is an actual percentage
value stored in a numeric field

HTH,
 
D

Douglas J. Steele

Rob Parker said:
Hi Steve,

Glad I'm not doing a course in your institution - a pass mark of 100% is
setting the bar awfully high ;-)

On the other hand, if they're teaching surgeons, I don't mind that! <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top