PC Review


Reply
Thread Tools Rate Thread

Converting numeric state postal code to 2 digit text

 
 
tbmarlie
Guest
Posts: n/a
 
      11th Aug 2010
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)
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jan 2010
Posts: 11
 
      18th Aug 2010
Hello tbmarlie. Have you tried using the Format() function? I think it is better than the CStr().
Code:
Format([State Num], "0000000000")
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting RIC1 code to letter Column/Numeric Row RidgeView Microsoft Excel Misc 5 8th Mar 2009 12:09 AM
Converting Text to Numeric Value cjfazio Microsoft Access 2 21st May 2008 01:07 AM
Re: Converting Text into a Numeric Value and Totalling Nick Microsoft Excel Worksheet Functions 0 10th May 2005 05:14 PM
Converting Text to Numeric Matt Microsoft Excel Programming 2 23rd Jan 2004 02:58 AM
converting 16 digit number to text Troy Microsoft Excel Programming 4 28th Oct 2003 12:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.