Text String Leading Zeros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have text strings in a field called HRID. I'm looking for a function that
will examine each item in HRID. If the length of the string equals 6, then
leave it as is. If less than 6, then add whatever number of leading zeros is
required to make the text string exactly 6 characters in length.

Any help would be appreciated!
 
Kirk P. said:
I have text strings in a field called HRID. I'm looking for a
function that will examine each item in HRID. If the length of the
string equals 6, then leave it as is. If less than 6, then add
whatever number of leading zeros is required to make the text string
exactly 6 characters in length.

Any help would be appreciated!

UPDATE YourTable
SET HRID = Right("000000" & HRID, 6);
 
Kirk said:
I have text strings in a field called HRID. I'm looking for a function that
will examine each item in HRID. If the length of the string equals 6, then
leave it as is. If less than 6, then add whatever number of leading zeros is
required to make the text string exactly 6 characters in length.


Right("000000" & HRID, 6)
 
Back
Top