Converting numeric state postal code to 2 digit text

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)
 
Joined
Jan 12, 2010
Messages
12
Reaction score
0
Hello tbmarlie. Have you tried using the Format() function? I think it is better than the CStr().
Code:
Format([State Num], "0000000000")
 

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