From: Oliver G. <oli...@we...> - 2001-09-25 13:57:58
|
Larry W. Virden wrote: >>A leading zero serves no purpose, it doesn't change >>the value of the number. >> > > A leading zero does serve a purpose actually - if one is keying in a > password that includes a leading zero, then dropping it leaves one > without the knowledge of whether it is needed or not. > I have to disagree! If you want to use a number field, then the numbers should be handled and stored mathematically correct. As a number, 1234 is the same as 01234. If you display it with leading zeros, then it's just that: a formatting convention for display purposes. If you want to store a sequence of numbers or characters exactly as you enter it, then use a string. > Rather than trying to make assumptions of what the user of a package > needs, I recommend leaving what someone types into a field EXACTLY as > they type it. If a field has entry contraints, just don't let the > wrong kind of data be entered into the field in the first place. > The creator of the database has to determine what he or she wants to store and chose the field types accordingly. Storing a number in such a way that leading zeros are stored with it makes no sense to me. BTW, storing the number as a string EXACTLY as it was entered by the user would be making an assumption about what the user wants to do with it later as well. Regards, Oliver -- Oliver Goetz, mailto:oli...@we... "I'd rather laugh with the sinners than cry with the saints Sinners are much more fun... And only the good die young" -- Billy Joel |