Calculated value - round up??

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....
 
J

John Spencer

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

-INT(-(YourCalculation))
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top