Add leading zeros and concatenation

  • Thread starter Thread starter EllenM
  • Start date Start date
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
 
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
 
Thanks, Jeff. I used "GRN" & Format([GRAS ID no],"000000") in an update
query. Worked beautifully!!

Ellen
 
Back
Top