Zero Fill

D

David Billigmeier

Does Access have a way to zero fill every record of a specific variable up to
a specified length?

For example, I have a table that looks like:

12345
123456
12345678

And I would like to get it like this:

00012345
00123456
12345678

Thanks.
 
T

Thomas Winkler

Hi,
Does Access have a way to zero fill every record of a specific variable up to
a specified length?

For example, I have a table that looks like:

12345
123456
12345678

And I would like to get it like this:

00012345
00123456
12345678

If your field contains numeric values then it should be enough just to
_display_ these zeros. change the format-property of your field to
"00000000".

HTH

Thomas
 
D

David Billigmeier

Baz... Where would I put that code? Somewhere in the 'design view' for the
table?

Thanks.
 
D

David Billigmeier

These numbers are unique ID's that I'm trying to match to another table. The
entries in the other table were and always have been formatted as text so
they have their leading zero's still appended. However, in this table they
were formatted as a number at some point so the leading zero's were stripped
off. For example:

When trying to match "12345" to "000012345" Access would call this a
non-match, so I need to attach 4 0's to the "12345" before the query can be
run.

Does that make a little more sense?
Thanks.
 
Top