How format data to add zeros to alpha numeric data in query

C

CS

Need to add zeros to data like MCRD-472 to show MCRD-00472 and like NBC-2 to
show NBC-00002 and like NBC-M14 to show NBC-00M14. To Query text box.
 
K

KARL DEWEY

If YourField always has a dash which you want to follow with filler zeros
then this --
Left([YourField], InStr([YourField], "-")-1) & Right("00000" &
Mid([YourField], InStr([YourField], "-")+1)
 
K

KARL DEWEY

One mo time --
Left([YourField], InStr([YourField], "-")-1) & Right("00000" &
Mid([YourField], InStr([YourField], "-")+1, 5)
 

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