Rounding in Access

J

Josh

I have a table with a list of products, the amount of inventory I want for Ea
product and what the products order amount is. How do I round the Inventory
I want to keep, to a multile of the standard pack Quantity?
 
J

Jeff Boyce

Josh

"rounding" is usually reserved for decimal fractions ...

And since we're not there, we can't see how you are keeping track of
products (e.g., your table structure and business rules). Your description
seems to imply that you have individual product counts, but that you also
have a ?PackQuantity?.

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KARL DEWEY

Will this do it for you?
Cartons: Int([InventoryCount] / [CartonSize])
or
Cartons: [InventoryCount] \ [CartonSize]
 
V

vanderghast

I suspect it would be

- cartonSize * int( - inventoryCount / cartonSize )



unless the quantity required is in number of cartons, if so:

- int( - inventoryCount / cartonSize )


with the -int(-x) would return 1, that is, 1 carton, if x = 0.0000001,
as example, rather than returning 0 carton with the simple int(x).



Vanderghast, Access MVP


KARL DEWEY said:
Will this do it for you?
Cartons: Int([InventoryCount] / [CartonSize])
or
Cartons: [InventoryCount] \ [CartonSize]

--
Build a little, test a little.


Josh said:
I have a table with a list of products, the amount of inventory I want
for Ea
product and what the products order amount is. How do I round the
Inventory
I want to keep, to a multile of the standard pack Quantity?
 

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