Rounding Numbers UP

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

Guest

Hello i am creating a database in access and i am wantin to know if it is possible to round all the queries that i create up? is this possibl
e.g i want
33.1 to become 34
33.00001 to become 3
etc
 
This is from the help section in access
ROUNDUP
Rounds a number up, away from 0 (zero).

If this function returns the #NAME? error value, you may
need to install msowcf.dll.

Syntax

ROUNDUP(number,num_digits)

Number is any real number that you want rounded up.

Num_digits is the number of digits you want to round
to. Negative rounds to the left of the decimal point; 0
(zero) or omitted rounds to the nearest integer
-----Original Message-----
Hello i am creating a database in access and i am wantin
to know if it is possible to round all the queries that i
create up? is this possible
 
-----Original Message-----
Hello i am creating a database in access and i am wantin
to know if it is possible to round all the queries that i
create up? is this possible
e.g i want
33.1 to become 34
33.00001 to become 34
etc
.
Lets call the variable you're rounding = "nbr"

rounded number: iif(clng([nbr])>[nbr],clng([nbr])-1,clng
([nbr]))

That is my best guess and has not been tested. Basically,
the clng formula rounds the number and the iif statement
says if it's bigger than the original, subtract one and if
smaller than it is correct.
 
I'm soory but could you tell me how to implement this, i am confused as to where to put the sytax?
 
Are the numbers ALWAYS positive? If so, the following will work

Field: NewValue: -Int(-NumberField)
 
The Help gets confused sometimes!

I believe RoundUp is an Excel VBA function, NOT Access VBA function. Hence,
it won't work in Access without automation.
 
Back
Top