Decimal Place Format Help

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

    #1

    Decimal Place Format Help

    I need to change the decimal value in one of my databases. Currently my company uses an ID system with nice whole numbers, i.e. no decimal numbers. Now my boss has this grand scheme to start using decimals. 1.17.1 etc. I can't seem to be able to get my table and form to accept the change??? In my table I currently changed the "Decimal Places" to 2 and the "Format" to "General Number". I then tell it to update format everywhere the ID is used. I have gone into my form based on this table and set the specific field to allow decimal places as well. It won't work. When I enter a number directly into my table, 2.1, the field reverts to 2. ????? What am I doing wrong here? and... is it possible to set the format to allow numbers such as 1.12.4 but not allow any letters?
    Thanks for any Help
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Hmm, the problem your boss is introducing is the fact that the code is now "leveled".
    In your table you should have a Main, sub level, sub sub level, etc. field or (fully normalized) for each level a row in the table and a pointer to the higher level.

    To stay "de-normalized" the only solution is to change the code into a text field. Using a mask or code in a key event could be used to prevent non numeric characters to be entered.

    Is the max number of levels known ?

    Nic;o)

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by MyWaterloo
      I need to change the decimal value in one of my databases. Currently my company uses an ID system with nice whole numbers, i.e. no decimal numbers. Now my boss has this grand scheme to start using decimals. 1.17.1 etc. I can't seem to be able to get my table and form to accept the change??? In my table I currently changed the "Decimal Places" to 2 and the "Format" to "General Number". I then tell it to update format everywhere the ID is used. I have gone into my form based on this table and set the specific field to allow decimal places as well. It won't work. When I enter a number directly into my table, 2.1, the field reverts to 2. ????? What am I doing wrong here? and... is it possible to set the format to allow numbers such as 1.12.4 but not allow any letters?
      Thanks for any Help
      is it possible to set the format to allow numbers such as 1.12.4 but not allow any letters?
      The following Input Mask requires Digits in positions 1, 2, 3, and 4, whereas the 5th Digit is not required. You can use this as a starting point:
      Code:
      0.00.09

      Comment

      • MyWaterloo
        New Member
        • Dec 2007
        • 135

        #4
        "Is the max number of levels known ?"
        I am not exactly sure what you mean by this question? So i guess, no, the max number of levels is not known.



        "The following Input Mask requires Digits in positions 1, 2, 3, and 4, whereas the 5th Digit is not required. You can use this as a starting point:"

        0.00.09

        I tried implementing the input mask you recommended. I had to change my data type to text instead of number. I assume this is what I was intended to do? I then relly on the input mask to only allow numbers. Correct?
        Thanks

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by MyWaterloo
          "Is the max number of levels known ?"
          I am not exactly sure what you mean by this question? So i guess, no, the max number of levels is not known.



          "The following Input Mask requires Digits in positions 1, 2, 3, and 4, whereas the 5th Digit is not required. You can use this as a starting point:"

          0.00.09

          I tried implementing the input mask you recommended. I had to change my data type to text instead of number. I assume this is what I was intended to do? I then relly on the input mask to only allow numbers. Correct?
          Thanks
          I tried implementing the input mask you recommended. I had to change my data type to text instead of number. I assume this is what I was intended to do? I then relly on the input mask to only allow numbers. Correct?
          That is correct, the Field would have to be defined as Text for this to work.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Your code "1.17.1" represents 3 levels:
            1 - Main
            17 - Sub
            1 - SubSub
            In general such a leveled code is used for grouping products.
            Storing this in three number fields and concatenating them when needed for output is the "normalized " way.

            So showing this would give a query field like:
            Code:
            SELECT Main & "." & Sub & "." & SubSub as LeveledCode, ...
            FROM tblX;
            Having different fields will allow to check easily for each level value to be valid. E.g. Main can be in the range 1 to 4, etc.
            Getting the idea ?

            Nic;o)

            Comment

            Working...