Which field has the greater value

gmatriix

Registered User.
Local time
Today, 07:02
Joined
Mar 19, 2007
Messages
365
Hello All,

I have 3 fields with numeric values in them. I just want to know which one is greater (dmax or something) and lowest (Dmin or something)

Example

Field1
6

Field2
5

Field3
7

How do I dmax 3 fields? this would return 7
Dmin would return 5

Any Ideas?

Thx
 
You could us a nested IIF. Something like this, perhaps?


RequiredValue = IIf((Field1 > Field2) AND (Field1 > Field3), Field1, IIf(Field2 > Field1) AND (Field2 > Field3), Field2, IIf(Field3 > Field1) AND (Field3 > Field2), Field3, Field1)

If one field is larger than the others, that will be returned.
If all are the same, it uses the first one.
 
Alc

Thanks Alot....I though about nested iifs but I wasn't sure if there was another way. anyways.....I appreciate your help! I will follow your example..

Thanks,
 

Users who are viewing this thread

Back
Top Bottom