Auto fill in missing digits

T

txlogic

I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table. How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?
 
P

Piet Linden

I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table.  How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?

What is the data type of this field? If it's numeric, then you can't
keep the leading zeros. If it's not a field that you do math on, it
should probably be a text field anyway.

You can use Format$() to do this.
 
J

John W. Vinson

I have a file I am importing into a table and if the number begins with one
or two 0's they are missing from the data in the new table. How can i set up
the formatt on the table so the numbers are a set length and if not, it will
automatically fill in the missing 0's?

Use a Text field, not any sort of number. As numbers, 31 and 031 and
0000000000031 are just three different ways of depicting *exactly the same
number*.
 
S

Steve

For clarification, it is wrong to refer to 031 and 0000000000031 as numbers.
There are absolutely no numers that look like 031 and 0000000000031. Both
031 and 0000000000031 are character strings and therefore text data type.
You are one-hundred percent correct in saying "Use a Text field".

Steve
 

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