PC Review


Reply
Thread Tools Rate Thread

changing a number to text

 
 
pat67
Guest
Posts: n/a
 
      20th Sep 2010
What i have is 10 what i need to see is 00010. Or if it is 150 I need
to see 00150. In other words I need to add zeros to the front of the
number to create a length or 5 characters. In Excel i just do
text(cell,"00000"). In Acess i tried using Plain Text function, but i
still get 10 or 150 when I use PlainText([Field],5) where 5 is the
length. Any ideas?

Thanks
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      20th Sep 2010
On Mon, 20 Sep 2010 12:36:06 -0700 (PDT), pat67 <(E-Mail Removed)> wrote:

>What i have is 10 what i need to see is 00010. Or if it is 150 I need
>to see 00150. In other words I need to add zeros to the front of the
>number to create a length or 5 characters. In Excel i just do
>text(cell,"00000"). In Acess i tried using Plain Text function, but i
>still get 10 or 150 when I use PlainText([Field],5) where 5 is the
>length. Any ideas?
>
>Thanks


A Number has no leading zeros - in a Number field, 10 and 00010 and
00000000000010 are exactly the same value.

If you need to convert a Number field to a Text field with leading zeros, you
can use the Format() function, which accepts a number and returns a string:

Format([number], "00000")

will cast the value in the field [number] into a five-character string with
leading zeros.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
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
Changing text to number DIAMONDGIRL Microsoft Excel Worksheet Functions 3 7th Nov 2008 04:10 PM
SQL for changing number into text without UPDATE Student Databaser Microsoft Access Queries 3 21st May 2008 06:04 PM
REP: Changing Text to Number =?Utf-8?B?TGlzYQ==?= Microsoft Access Queries 1 1st Aug 2007 04:15 PM
Changing Text to Number Problem. john Microsoft Excel Misc 6 10th Feb 2004 03:52 PM
Changing a text field to a number Michel Khennafi Microsoft Excel Discussion 1 4th Aug 2003 03:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:02 AM.