put zero in front number

mr_amen

New member
Local time
Yesterday, 19:22
Joined
Jul 26, 2010
Messages
4
hello, i want to know how to put a zero (0) in front of number.
i've created a table with number type field.
when i enter 001 it's become 1.
another thing to remember, 001 is not same with 1.
is it possible??
thanks...
 
Change the property to text

Although in the description given by the OP suggests the field needs to be text in this case, note this is not always the right solution. If the value is actually a number and you just want to display leading zeros it should be kept as a number and the Format property of the field set to 000.

As text, the values will be treated differently by Access.

Storage will be larger because the original integer held as two to four bytes will require two bytes per character as text.

Moreover, all processing of these values would be slower not only due to the larger size but, since Access is case insensitive, it will make all comparisons character by character against both upper and lower case.
 
Although in the description given by the OP suggests the field needs to be text in this case, note this is not always the right solution. If the value is actually a number and you just want to display leading zeros it should be kept as a number and the Format property of the field set to 000.

I agree this would be the best situation if the OP wants this field as a primarykey or a field of importance in his db.

JR
 

Users who are viewing this thread

Back
Top Bottom