Zero fill Text field

L

Les

I have a need to change a numeric field to a text field.
With this in mind I need to zero fill the left side of the
field.

Is there any easy suggestions?
 
J

John Vinson

I have a need to change a numeric field to a text field.
With this in mind I need to zero fill the left side of the
field.

Is there any easy suggestions?

Back up your database first, as always before making design changes!

If you want the field to be 8 bytes long, I'd suggest creating an
(empty) text field in your table; then run an Update query updating
the new field to

Format([numberfield], "00000000")

For other lengths use more or fewer zeros as appropriate.

You can then check the result, carefully, and delete the numeric
field.
 

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