# Thread: Trying to do IIF statement with two critieria

1. Registered User
Join Date
Apr 2015
Posts
4

## Unanswered: Trying to do IIF statement with two critieria

The statement is as follows
=IIf(Nz([1-30 Days]) And Nz([31-60 Days days]) And Nz([61-90 Days days]) And Nz([91-180Days days]) And Nz([180-360Day days]) And Nz([Over360Day days])>=0,0 Or IIf(Nz([1-30 Days]) And Nz([31-60 Days days]) And Nz([61-90 Days days]) And Nz([91-180Days days]) And Nz([180-360Day days]) And Nz([Over360Day days])<=0,([ConsultFee])))

Basically what I am trying to do is if there is a negative number or a zero in the following fields the consultant fee will come back as zero. If there is a number greater than zero the consultantfee will come back with the fee for that invoice.

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
what is [1-30 days]
what are you comparing it to to get your boolean evaluation

do you mean
IIf(Nz([1-30 Days]) <= 0 OR Nz([31-60 Days days]) <= 0...,0, [ConsultFee])
Im guessing you want to display the consultfeee if there is a positive number on anyone of those values [1-30 days],......

3. Registered User
Join Date
Apr 2014
Location
Kentucky
Posts
630
If your IIF statements get THAT complicated, then make a Function.
Then the query field would be: calcDays([day])

Join Date
Nov 2004
Location
out on a limb
Posts
13,692