MS Access Comparing 3 Values

E

eddie1209

Hello all,

I need to compare 3 values in MS Access and when they are all the same it should say true, if even 1 is incorrect it should say false.

Can anyone help me with a formula?

Below is an example.

Value 1 | Value 2 | Value 3

2 | 2 | 1 False
3 | 3 | 3 True
| | 1 False
2 | | 2 False

Thanks in Advance,

Edward
 
J

John W. Vinson

Hello all,

I need to compare 3 values in MS Access and when they are all the same it should say true, if even 1 is incorrect it should say false.

Can anyone help me with a formula?

Below is an example.

Value 1 | Value 2 | Value 3

2 | 2 | 1 False
3 | 3 | 3 True
| | 1 False
2 | | 2 False

Thanks in Advance,

Edward

(Value1=Value2 AND Value1=Value3)

--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
E

eddie1209

Hey John,
Thanks for your reply! I tried this already. But then i only get the values 0 and-1
 
E

eddie1209

Tried them both and I am still getting -1 and 0 as a result. Do I have to make another column to turn these values into true and false?
 
J

John W. Vinson

Tried them both and I am still getting -1 and 0 as a result. Do I have to make another column to turn these values into true and false?

-1 IS True, and 0 IS false. That's how they're stored in Access.

If you want the words "True" and "False" you can use

IIF(Value1 = Value2 AND Value2 = Value3, "True", "False")

The equality test just needs to compare either of the possible pairings. If
Value1 = Value2 and Value2 = Value3, then it is an absolute certainty that
Value1 = Value3; two things that are both equal to a third thing are equal to
each other.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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