Rounding up

M

Mark

Hello all,

I done some searching on rounding up, but none seem to be what I am looking
for.

Here’s what I need to do.


If myTotal field is greater > then 40, divided / by 30 then round up to
nearest dollar.

Example:

myTotal = 43
Divide by 30 = 1.433333333
Round up to nearest dollar = 2


I have been trying something like this (below), but the result is 1, how do
I get it to round up?

FYI:
I have > 40 on the criteria of the myTotal field.

Results: Int([myTotal]/30*1)/1
 
J

John Spencer

- Int (- 40/30) = 2

- Int(40/30 * -1) = 2

This works well with positive numbers
 
M

Mark

Mr Dinh,

Thank you very much. From my searches on rounding I see you are a rounding
guru. Have a good day!

Van T. Dinh said:
- Int( - MyTotal / 30 )

--
HTH
Van T. Dinh
MVP (Access)



Mark said:
Hello all,

I done some searching on rounding up, but none seem to be what I am
looking
for.

Here's what I need to do.


If myTotal field is greater > then 40, divided / by 30 then round up to
nearest dollar.

Example:

myTotal = 43
Divide by 30 = 1.433333333
Round up to nearest dollar = 2


I have been trying something like this (below), but the result is 1, how
do
I get it to round up?

FYI:
I have > 40 on the criteria of the myTotal field.

Results: Int([myTotal]/30*1)/1
 
K

Klatuu

I like the other solutions better, but here is another just for grins:

= 40\30 + iif( 40 mod 30 > 0, 1, 0)
 

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