# Round Up in Access 2002

G

#### Guest

I am having a problem with Access rounding up to the nearest whole number.
Example: 2.5 should round up to 3.

I have looked everywhere in help, there is not a RoundUp function. HELP!!!!!

In mathematics, that would be a "Ceiling" function.
There's probably one available is some library somewhere,
but it's probably simpler to create a public function and
call it. Here's what I came up with, using the Round
function:

-----------------------------------------
Public Function RoundUP(RoundMe As Double)

End If

End Function
-----------------------------------------

You should be able to call that function in a query or
whatever with the following syntax:

RoundUP(NumericVariable)

Hope that helps!

DBS (David Staas)

Hi David,
Are you saying I should customize a function? I am at in Intermediate level
with Access and am having trouble understanding the below. I am trying to
duplicate a formula I had in Excel, into Access. Excel had a RoundUp
function that I frequently used.

Tiffani

Hi David, I figured that you were talking to create a Module. I created the
module, however, I am trying to build the expression and am having trouble.
My expression in a calculated field in Query Design looks like this Total
Qty:= RoundUP(NumericVariable)[Qty Ord]*[Pck]/[MED Item Allowable]).

can you help with how I should be phrasing?

David THANKS! You were telling me to write a new module. I did it and it
works!!!Yeah!!!

Use the expression:

-Int(-YourNumber)

For example:

?-Int(-2.5)
3

If YourNumber can be negative, chect whether you want to
use Int() or Fix().

HTH
Van T. Dinh
MVP (Access)

If any number greater than a whole number should be rounded up, you can do
this in a query with the following:
int(NumToRoundup) +1

Int(1.0) + 1 = 2

Roundup(1.0) = 1

(david)

JasDal said:
If any number greater than a whole number should be rounded up, you can do
this in a query with the following:
int(NumToRoundup) +1