Numbers in text field, format with leading zeros

G

Guest

Hello:

Maybe I'm making too much of this. I have an employee ID field that I'm
importing from another source. The field is a text field of 8 numbers with
leading zeros.

I can make the zeros appear when I set my tables field property to number
and use the 00000000 format. However, I can't seem to get the same effect
with a text field. I'm sure it's user error.
 
J

Jeff Boyce

Victoria

If the leading zeros have meaning (as they do, for example, in East Coast
USA Zip Codes starting with "0"), then use a text data type and simply enter
the "0"s.

If you will be adding/subtracting/multiplying/dividing the EmployeeID
numbers (I can't imagine why?!), then use a numeric data type.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Jeff's advice is perfectly correct.

You are right - using Text property will presume the 000s are just part of
the text and ok. While in number property...a number begining with 000s
views those 000s as meaningless and thus they are dropped.

That is just the way it is.

If you want to have it as Text property AND must drop the 000s then look
into the "Trim" function.... may or may not be a solution for you depending
on your exact need and situation....
 

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