Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rounding Up Only ?

1 view
Skip to first unread message

Joe "Nuke Me Xemu" Foster

unread,
Mar 16, 2001, 4:17:04 PM3/16/01
to
"ZuckermanF" <zucke...@aol.com> wrote in message <news:20010316132039...@nso-ma.aol.com>...

> Or just add 1 to the int():
> Int( UnitQtyOrdered * QtyOfMaterialPerUnit ) + 1

Int(1 * 1) + 1

--
Joe Foster <mailto:jfo...@ricochet.net> Sacrament R2.45 <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!


ZuckermanF

unread,
Mar 16, 2001, 1:20:39 PM3/16/01
to
Or just add 1 to the int():
Int( UnitQtyOrdered * QtyOfMaterialPerUnit ) + 1
Fred Zuckerman
San Diego, CA, USA

>
>Take advantage of the way Int() rounds down, by making the
>number negative, applying Int(), and negating the result:
>
> - int(-UnitQtyOrdered * QtyOfMaterialPerUnit)
>


Robert G. Carter

unread,
Mar 15, 2001, 1:55:24 PM3/15/01
to
Is there a way to have a query calculation round up only, whether the
result is x.001, x.01, x.1 ; ... etc.?
There is the ROUNDUP function in Excel. I need to do something similar
in Access 97 for a material take-off calculation.
An help would be most appreciated.

Thanks,
Bob Carter

______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
With Servers In California, Texas And Virginia - The Worlds Uncensored News Source

Karl Irvin

unread,
Mar 15, 2001, 2:21:40 PM3/15/01
to
The following function rounds up to the next tenth of an hour.

Public Function BillHours(Minutes As Double)
BillHours = (Int(((Minutes / 60) + 0.09) * 10)) / 10
End Function

Robert G. Carter wrote in message ...

Robert G. Carter

unread,
Mar 15, 2001, 4:19:42 PM3/15/01
to
My apologies. I was not clear enough.

The initial results are derived from a query calculation

UnitQtyOrdered * QtyOfMaterialPerUnit

I am trying to round up this result to the next whole number.

If my result is 4.015 I need to round up to 5.
If my result is .333 I need 1.
If .035 then 1

If the number is already whole then do nothing.
For example if the result 12.0 then 12

The rounded numbers are the actual material order quantities


Thanks,
Bob Carter

Joe "Nuke Me Xemu" Foster

unread,
Mar 15, 2001, 3:05:47 PM3/15/01
to
"Robert G. Carter" <pathw...@digifaction.com> wrote in message <news:oo32btc5ns2g94bqe...@4ax.com>...

> Is there a way to have a query calculation round up only, whether the
> result is x.001, x.01, x.1 ; ... etc.?
> There is the ROUNDUP function in Excel. I need to do something similar
> in Access 97 for a material take-off calculation.
> An help would be most appreciated.

Something like this: -int(0.0001 - x)

3.0001 will round up to 4, but 3.00001 will not. What if x is negative?
Do you want to round up, or round away from zero?

--
Joe Foster <mailto:jfo...@ricochet.net> Greed = God? <http://www.xenu.net/>

Van T. Dinh

unread,
Mar 15, 2001, 9:09:21 PM3/15/01
to
Robert

There was a thread about this a short while back. This expression

CLng([UnitQtyOrdered] * [QtyOfMaterialPerUnit] + 0.49999999999)

should round up your result to the next whole number.

HTH
Van T. Dinh

"Robert G. Carter" <pathw...@digifaction.com> wrote in message
news:6sb2btc7ha1vbvrsn...@4ax.com...

Allen Browne

unread,
Mar 15, 2001, 9:08:11 PM3/15/01
to
Take advantage of the way Int() rounds down, by making the
number negative, applying Int(), and negating the result:

- int(-UnitQtyOrdered * QtyOfMaterialPerUnit)


"Robert G. Carter" wrote:
>
> My apologies. I was not clear enough.
>
> The initial results are derived from a query calculation
>
> UnitQtyOrdered * QtyOfMaterialPerUnit
>
> I am trying to round up this result to the next whole number.
>
> If my result is 4.015 I need to round up to 5.
> If my result is .333 I need 1.
> If .035 then 1
>
> If the number is already whole then do nothing.
> For example if the result 12.0 then 12
>
> The rounded numbers are the actual material order quantities

--
Perth, Western Australia
Tips for MS Access users at:
http://odyssey.apana.org.au/~abrowne

Van T. Dinh

unread,
Mar 15, 2001, 9:06:05 PM3/15/01
to

"Robert G. Carter" <pathw...@digifaction.com> wrote in message
news:6sb2btc7ha1vbvrsn...@4ax.com...

Robert G. Carter

unread,
Mar 16, 2001, 12:05:20 AM3/16/01
to
To all a heartfelt thank-you.
You do not know how much you have helped.
0 new messages