Leading zeros in text field

  • Thread starter Thread starter Troy
  • Start date Start date
T

Troy

Hello! I have a field in a table that is text type. I need to append leading
zero's to the left of the number so that the number is equal to 3 digits.

Example:
001
002
003
 
Hello! I have a field in a table that is text type. I need to append leading
zero's to the left of the number so that the number is equal to 3 digits.

Example:
001
002
003

You can do this in one swell foop using an Update query:

UPDATE yourtable
SET fieldname = Right("000" & [fieldname], 3)
WHERE Len([fieldname]) < 3;
 
You are GREAT! Thank You!!!

John W. Vinson said:
Hello! I have a field in a table that is text type. I need to append leading
zero's to the left of the number so that the number is equal to 3 digits.

Example:
001
002
003

You can do this in one swell foop using an Update query:

UPDATE yourtable
SET fieldname = Right("000" & [fieldname], 3)
WHERE Len([fieldname]) < 3;
 
Back
Top