Formula in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want the value of the following formula to equal 0 if it is less than 0.
Any value greater than 0 should remain the same. Can I do that?

OT: ((([hrs20]+[hrs21]+[hrs22]+[hrs23]+[hrs24]+[Hrs25]+[Hrs26]))-40)
 
IIF( ((([hrs20]+[hrs21]+[hrs22]+[hrs23]+[hrs24]+[Hrs25]+[Hrs26]))-40) >0, 0,
((([hrs20]+[hrs21]+[hrs22]+[hrs23]+[hrs24]+[Hrs25]+[Hrs26]))-40))

IIF ( your formula > 0 , 0, your formula)
 
Of course if any of the fields have a null value then you are going to end up
with a null result, no matter what you do.

OT: IIF(((([hrs20]+[hrs21]+[hrs22]+[hrs23]+[hrs24]+[Hrs25]+[Hrs26]))-40)<0,0,((([hrs20]+[hrs21]+[hrs22]+[hrs23]+[hrs24]+[Hrs25]+[Hrs26]))-40))
 
Back
Top