Calculated value - round up??

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

Guest

Hi all,

I have a calculated value in a query and it returns a decimal in many cases
that I need rounded up to the next whole number.

The Round function that I know will round accurately up or down and I need a
round up only.

Is there another function in Access or do I need to go over to VBA and set
up a more complex expression?......

thanks....
 
Is the calculated value always positive. If so, you can use the following

-INT(-(YourCalculation))
 
The Int function strips off the decimal. If you are expecting any negative
numbers, check the Fix function as it and Int behave differently with
negative numbers. The IIf statement checks if the Int of a number is equal to
the number. If so it just does the simple math. If not, it strips off the
integer, does the math, then adds one to round up.

Expr3:
IIf(Int([DENSITY])*500=[DENSITY]*500,[DENSITY]*500,Int([DENSITY]*500)+1)
 
Back
Top