469,610 Members | 2,060 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Total on Hand Question

135 100+
I need some help with an inventory type question. To lay the foundation... I have an inventory database that keeps track of parts for rebuilds. The tables are: CATEGORIES which is linked to table PRODUCTS. The PRODUCTS table is the parts needed to rebuild the items in the CATEGORIES table. I have a form where I can pick a category that will open a new form showing all the parts (from table PRODUCTS) that relate to that category (from table CATEGORIES). I can then open an individual PRODUCT form to view the current state of that product relating to the specific CATEGORY. Ok, I hope that made sense. Pretty simple basic access stuff. My question is this: On my form for the individual products I have fields that show the total number of that particular product needed for rebuild as well as the total number of products actually on hand. How do I show how many sets of rebuilds I have left? Let's say it takes 5 items per rebuild and I have 7 on hand. How do I show that I have 1 rebuild on hand. Or how do I show I have, say, enough items for 3 rebuilds if I have 17 items? How do I show 1 rebuild per set of 5? I am currently trying to sum the total "on hand" and divide it by the rebuild amount. The problem with that is I get an answer like 2.5557. If I select "0" decimal places format it rounds up to 3. Kind of stumped.
Apr 12 '09 #1
3 1371
missinglinq
3,532 Expert 2GB
This is an easy one! When dividing use the backslash; it returns only the Integer part of the division!

17/5 = 3.4

but

17\5 = 3

Linq ;0)>
Apr 12 '09 #2
MyWaterloo
135 100+
.................(stunned silence)............... LOL I can't believe that was as easy as just a backslash. Thanks
Apr 12 '09 #3
missinglinq
3,532 Expert 2GB
The backslash is an operator a lot of people are unaware of. You could have also used Int() which returns the Integer portion of a number or expression that evaluates as a number.

Int(17/5) returns 3.

Linq ;0)>
Apr 12 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by James Greig | last post: by
2 posts views Thread by Jon | last post: by
16 posts views Thread by ken | last post: by
17 posts views Thread by M.Siler | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.