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

Decimal Place Format Help

100+
P: 135
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
Jan 2 '09 #1
Share this Question
Share on Google+
5 Replies


nico5038
Expert 2.5K+
P: 3,072
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)
Jan 2 '09 #2

ADezii
Expert 5K+
P: 8,616
@MyWaterloo
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:
Expand|Select|Wrap|Line Numbers
  1. 0.00.09
Jan 3 '09 #3

100+
P: 135
"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
Jan 3 '09 #4

ADezii
Expert 5K+
P: 8,616
@MyWaterloo
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.
Jan 3 '09 #5

nico5038
Expert 2.5K+
P: 3,072
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:
Expand|Select|Wrap|Line Numbers
  1. SELECT Main & "." & Sub & "." & SubSub as LeveledCode, ...
  2. 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)
Jan 3 '09 #6

Post your reply

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