Help! Trying to set a maximum value on a query result.

  • Thread starter Thread starter scipio
  • Start date Start date
S

scipio

Greetings, and apologies in advance for my noobiness. I have a query
that calculates percent, easy enough:

"Percent Loans: [Loans]/[Total Proj Cost]"

Now I would like to put a maximum cap on the value it returns, ie. 25%
or .25, so that the result of every calculation will either be 0.25 (if
the value is >= .25) or it's actual value if it is less.

Thanks in advance.
 
Percent Loans: IIF([Loans]/[Total Proj Cost]>.25,.25, [Loans]/[Total Proj Cost])

By the way that will error if Total Proj Cost is ever zero. You will get a
divide by zero error.
 
Back
Top