How can I always round up decimal values to the nearest integer value?

Shaun picture Shaun · Apr 1, 2010 · Viewed 15.7k times · Source

On a report I have the following code for a field:

=Sum([PartQty]*[ModuleQty])

Example results are 2.1 and 2.6. What I need is for these value to round up to the value of 3. How can I change my field code to always round up the results of my current expression?

Answer

RLH picture RLH · Dec 20, 2012

This is an old Access trick I learned a very long time ago, and it makes use of the way Access handles fractional, negative numbers. Try this:

-Int(-[DecimalValue])

It's odd, but it will always round your numbers up to the nearest whole number.