PC Review


Reply
Thread Tools Rate Thread

convert a numeric variable to a character variable

 
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      28th Jun 2006
Hi all,

Please help for converting a numeric variable to a character variable in
access. Thank you.

I have a variable name ID, it is a numeric variable,
89
90
11123
.........
I would like to convert it to a character, if it less than five digits, then
I need have 0s added at the beginning. it should show up like:
00089
00090
11123
.........

Please help, thank you,

Blinda




 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      28th Jun 2006
Try

Format([variable], "00000")


--
Good Luck
BS"D


"Blinda" wrote:

> Hi all,
>
> Please help for converting a numeric variable to a character variable in
> access. Thank you.
>
> I have a variable name ID, it is a numeric variable,
> 89
> 90
> 11123
> ........
> I would like to convert it to a character, if it less than five digits, then
> I need have 0s added at the beginning. it should show up like:
> 00089
> 00090
> 11123
> ........
>
> Please help, thank you,
>
> Blinda
>
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      28th Jun 2006
Cohen,

Thank you. I can change the numeric variable to the format of "00089", but
it is still number not a character. I did that in the table: design view-->
format--->\00000

If you know how to change it to character, please show me. Thanks.

Blinda

"Ofer Cohen" wrote:

> Try
>
> Format([variable], "00000")
>
>
> --
> Good Luck
> BS"D
>
>
> "Blinda" wrote:
>
> > Hi all,
> >
> > Please help for converting a numeric variable to a character variable in
> > access. Thank you.
> >
> > I have a variable name ID, it is a numeric variable,
> > 89
> > 90
> > 11123
> > ........
> > I would like to convert it to a character, if it less than five digits, then
> > I need have 0s added at the beginning. it should show up like:
> > 00089
> > 00090
> > 11123
> > ........
> >
> > Please help, thank you,
> >
> > Blinda
> >
> >
> >
> >

 
Reply With Quote
 
hbinc
Guest
Posts: n/a
 
      28th Jun 2006
Blinda,

There is a VisualBasic-function CStr that converts almost any variable
to text.

Hbinc.



Blinda schreef:

> Cohen,
>
> Thank you. I can change the numeric variable to the format of "00089", but
> it is still number not a character. I did that in the table: design view-->
> format--->\00000
>
> If you know how to change it to character, please show me. Thanks.
>
> Blinda
>
> "Ofer Cohen" wrote:
>
> > Try
> >
> > Format([variable], "00000")
> >
> >
> > --
> > Good Luck
> > BS"D
> >
> >
> > "Blinda" wrote:
> >
> > > Hi all,
> > >
> > > Please help for converting a numeric variable to a character variable in
> > > access. Thank you.
> > >
> > > I have a variable name ID, it is a numeric variable,
> > > 89
> > > 90
> > > 11123
> > > ........
> > > I would like to convert it to a character, if it less than five digits, then
> > > I need have 0s added at the beginning. it should show up like:
> > > 00089
> > > 00090
> > > 11123
> > > ........
> > >
> > > Please help, thank you,
> > >
> > > Blinda
> > >
> > >
> > >
> > >


 
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
how do I convert numeric value to its character value ex. 10=Ten Shreesh Asthana Microsoft Excel Worksheet Functions 1 25th Apr 2008 09:16 AM
Reference Numeric Variable in Macro =?Utf-8?B?RGF2ZSBCaXJsZXk=?= Microsoft Excel Programming 7 25th Apr 2007 04:58 PM
Convert Excel variable to Access variable =?Utf-8?B?QW5keQ==?= Microsoft Access VBA Modules 4 17th Mar 2006 12:57 AM
Numeric variable in a SQL statement =?Utf-8?B?SmFjaw==?= Microsoft Access VBA Modules 3 25th Feb 2005 08:26 AM
How do I convert an integer variable to a string variable? =?Utf-8?B?ZHVtYmFzcw==?= Microsoft Excel Programming 2 21st May 2004 07:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.