Adding characters to to fill in spaces in fixed number strings

F

Frommbo

I have a field with numbers in a text format. What I'm
trying to do is add zeros to the front end of numbers
under a set string length. In other words, If the set
string length is 10, I want to add zeros to the left side
of all numbers that are less than 10 characters in length
to make it into a 10 character string. This would be to
make, for example, 1234567 into 0001234567.
 
F

Frommbo

Thank you Cheryl!

-----Original Message-----
Try:

Format([MyField], "0000000000")


hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Frommbo said:
I have a field with numbers in a text format. What I'm
trying to do is add zeros to the front end of numbers
under a set string length. In other words, If the set
string length is 10, I want to add zeros to the left side
of all numbers that are less than 10 characters in length
to make it into a 10 character string. This would be to
make, for example, 1234567 into 0001234567.


.
 
C

Cheryl Fischer

You're welcome and good luck with your project.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Frommbo said:
Thank you Cheryl!

-----Original Message-----
Try:

Format([MyField], "0000000000")


hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Frommbo said:
I have a field with numbers in a text format. What I'm
trying to do is add zeros to the front end of numbers
under a set string length. In other words, If the set
string length is 10, I want to add zeros to the left side
of all numbers that are less than 10 characters in length
to make it into a 10 character string. This would be to
make, for example, 1234567 into 0001234567.


.
 

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