How do I get a query to return a "Pass" or "Fail" on calculated data?

M

MrDangerous

I'm trying to get a query to return a "Pass" if a data value is less than
..000144 and "Fail" if greater than .000144. I can get a 0 or -1, but I can't
get it to associate 0 with "Fail" and -1 with "Pass." It's easy enough in an
Excel spreadsheet with an IF statement, but I can't figure out how to do it
with a query.
 
D

Doug

-----Original Message-----
I'm trying to get a query to return a "Pass" if a data value is less than
..000144 and "Fail" if greater than .000144. I can get a 0 or -1, but I can't
get it to associate 0 with "Fail" and -1 with "Pass." It's easy enough in an
Excel spreadsheet with an IF statement, but I can't figure out how to do it
with a query.


.
Try this. In the field row in your query enter something
like this: "chk: IIf([num1]>".000144","Fail","Pass")"

Doug
 
M

MrDangerous

Doug, if you were a pretty woman I'd kiss you, but since you probably not,
yuo'll have to settle for my gratitude. Many thanks, amigo.

Doug said:
-----Original Message-----
I'm trying to get a query to return a "Pass" if a data value is less than
..000144 and "Fail" if greater than .000144. I can get a 0 or -1, but I can't
get it to associate 0 with "Fail" and -1 with "Pass." It's easy enough in an
Excel spreadsheet with an IF statement, but I can't figure out how to do it
with a query.


.
Try this. In the field row in your query enter something
like this: "chk: IIf([num1]>".000144","Fail","Pass")"

Doug
 
V

Van T. Dinh

.... but be beware that you may be comparing Text rather
than numerically as you should. Also, you haven't specify
the case "equal".

Suggest:

chk: IIf([num1]>0.000144,"Fail","Pass")

Adjust the comparison operator to include "Equal" if
required.

HTH
Van T. Dinh
MVP (Access)
 

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