view leading zeros

S

Steve Goodrich

I have a field on my form which is set to number, all the numbers are 4
digits, some of the numbers start with a zero, when I enter the number
starting with a zero or two zeros the zeros are not displayed, e.g. entering
0012 will display only 12.
is it possible to display all 4 digits Inc the leading zeros. I need to
query this inf. in numerical order.

thanks for any help

steve
 
G

gls858

Steve said:
I have a field on my form which is set to number, all the numbers are 4
digits, some of the numbers start with a zero, when I enter the number
starting with a zero or two zeros the zeros are not displayed, e.g. entering
0012 will display only 12.
is it possible to display all 4 digits Inc the leading zeros. I need to
query this inf. in numerical order.

thanks for any help

steve
To view the leading zero's the field will have to be formatted as
text.

gls858
 
V

Van T. Dinh

Numerically 0012 is exactly the same value as 12.

If your Field is a Numeric Field, Access/JET will sort in numerical order
correctly without the leading zeros.

If you want to pad woth leading zeros, set the Format Property to "0000".

HTH
Van T. Dinh
MVP (Access)
 
J

Jeff Boyce

Steve

The responses you've received are pointing to the difference between data
type (what is stored) and display formatting. If having all four "places"
is significant, then you are using text/characters, not numbers.

Regards

Jeff Boyce
<Access MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top