How to always round up?

D

Darrell Childress

I am doing a calcuation in a query where I need to always round up the
result to the next highest whole number. In other words, if the result
is 9.125, I need the result to be 10. I used the help feature, but could
not find anything other than the standard Round function.
Thanks,
Darrell
 
G

Guest

-----Original Message-----
I am doing a calcuation in a query where I need to always round up the
result to the next highest whole number. In other words, if the result
is 9.125, I need the result to be 10. I used the help feature, but could
not find anything other than the standard Round function.
Thanks,
Darrell

.
Try using INT(Value + 1)
This will increase the value of your calculation by one
then return the integer part of the answer
 
J

John Spencer (MVP)

I think that will give bad results with exact integers.

10 should give 10, your solution gives 11.

See B. Camire's solution for something that will work with all positive numbers
and depending on what you want to have happen will work with negative numbers
also. -5.5 will return -5
 
D

Darrell Childress

Thanks, that works. Nice workaround.

Brian said:
You might use an expression in your query like:

-Int(-[Your Field])

I am doing a calcuation in a query where I need to always round up the
result to the next highest whole number. In other words, if the result
is 9.125, I need the result to be 10. I used the help feature, but could
not find anything other than the standard Round function.
Thanks,
Darrell
 

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