how to round up number using expression

P

Paul

I need to write an expression on rounding up a number to the nearest digit
in a query. The trick is the number have to round up rather than round down,
For example 2.6/2=1.3 or 3.4/2=1.7 and it shound all round up to 2. Thanks
 
K

Ken Snell [MVP]

This expression will round positive numbers up to next integer:

-Int(-MyNumber)

Replace MyNumber with the actual number or the name of the field.
 
V

Videotron

Paul,

The Int() function rounds a number down.
To round a number up: negate, use Int(), and negate the result:
=-Int(-[MyValue])

markfou
 
V

Videotron

Paul,
The Int() function rounds a number down.
To round a number up: negate, use Int(), and negate the result:

=-Int(-[MyValue])

markfou
 

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