By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,292 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,292 IT Pros & Developers. It's quick & easy.

Total on Hand Question

100+
P: 135
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
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
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

100+
P: 135
.................(stunned silence)............... LOL I can't believe that was as easy as just a backslash. Thanks
Apr 12 '09 #3

missinglinq
Expert 2.5K+
P: 3,532
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.