> 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!
>
>Take advantage of the way Int() rounds down, by making the
>number negative, applying Int(), and negating the result:
>
> - int(-UnitQtyOrdered * QtyOfMaterialPerUnit)
>
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
Public Function BillHours(Minutes As Double)
BillHours = (Int(((Minutes / 60) + 0.09) * 10)) / 10
End Function
Robert G. Carter wrote in message ...
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
> 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/>
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...
- 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