Add leading zeros and concatenation

E

EllenM

Hello,
I have a column of 1 to 3 digit numbers. I'd like to add leading zeros to
these numbers to make them 6 characters long. I know these values will have
to become text to do this.

After having done that, I'd like to concatenate these values with "GRN".
For instance:
4 becomes GRN000004
10 becomes GRN000010
777 becomes GRN000777

Thanks in advance,
Ellen
 
J

Jeff Boyce

Ellen

Plan on using a query to do this.

Check Access HELP for the Format() command -- you'll use it to display 4 as
000004.

Concatenating is easy, something like:

YourNewField: "GRN" & Format(...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
E

EllenM

Thanks, Jeff. I used "GRN" & Format([GRAS ID no],"000000") in an update
query. Worked beautifully!!

Ellen
 

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