Converting numeric state postal code to 2 digit text

  • Thread starter Thread starter tbmarlie
  • Start date Start date
T

tbmarlie

I'm trying to convert a state postal number that is of type integer
into a text that needs to be two digitits so it will have a leading
zero if the state is only 1 digit. So, I'm trying to do 2 things at
once 1) convert the integer to string and 2)pad with a leading zero if
the number is only one character. I think I'm close and I've tried
different variations, but just can't quite get it. Here is what I
have so far:

Left((Left(CStr([State Num])),2 & "00"),2)
 
Hello tbmarlie. Have you tried using the Format() function? I think it is better than the CStr().
Code:
Format([State Num], "0000000000")
 
Back
Top