IIf problems

kkershaw

Registered User.
Local time
Today, 18:27
Joined
Apr 11, 2002
Messages
17
I need a formula that uses a "nested" IF. Is this possible?

Here it is:

If miles > 0, then Miles*Rate per Mile

Otherwise If MinTons > 0, then MinTons *Rate,

Otherwise Tons * Rate.

In other words, if we have miles, it overrides everything else. If no miles then if minimum tons are greater than zero, multiply min. tons times rate, otherwise multiply tons times rate.

I can do this in Excel with nested "if" but can't seem to translate that to Access. Please advise!

Thanks. Karen
 
Iif([Miles]>0,[Miles]*[Rate],Iif([MinTons]>0,[MinTons]*[Rate],[Tons]*[Rate]))

Not tested but that should be the syntax:
Iif(Case A,True,FalseSoIif(Case B,True,Default))
 

Users who are viewing this thread

Back
Top Bottom