Total on Hand Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyWaterloo
    New Member
    • Dec 2007
    • 135

    #1

    Total on Hand Question

    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.
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    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)>

    Comment

    • MyWaterloo
      New Member
      • Dec 2007
      • 135

      #3
      ............... ..(stunned silence)....... ........ LOL I can't believe that was as easy as just a backslash. Thanks

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        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)>

        Comment

        Working...