I need to compare multiple values against a set of criteria and return a Pass or Fail. I need to do this whether I have just 1, 2, 3 or all 4 values. If any 1 value being compared does not meet the criteria then all being compared fail. The only Pass condition will be if all values being compared are good.
I thought I could do it like I have below in a query, but I am running into a problem with Access. It keeps putting a [ ] around the fail in the case of a comparison between two and around the Pass, Fail, Fail, Fail for the multiple comparison.
Result_Value_1: IIf([Value_A] Between 0.22 And 0.3, IIF([Value_B] Between 0.22 And 0.3,"Pass","Fail"),“[Fail]”)
Result_Value_2: IIf([Value_A] Between 0.22 And 0.3, IIF([Value_B] Between 0.22 And 0.3, IIF([Value_C] Between 0.22 And 0.3,”[Pass]”,"[Fail]"),“[Fail]”),”[Fail]”)
This is a picture from the query that shows Access putting the brackets in.
So when you run the query it asks for a value for each. I just click OK without putting anything in and it works, I think. So it must be something simple that I am missing or don’t know about.
I am new to Access and don’t know much about VBA or anything like that, but I am willing to try.