Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number to String conversion

Status
Not open for further replies.

mayukhg

IS-IT--Management
Jun 1, 2004
1
US
How do I convert a number to a string without
a. getting the decimal point
c. padded zeros on the number field

for example

1118301 is the nbr, after conversion it becomes '1118301.'
i tried using this

varchar(int(nbr_field)), it gives me positive results but the number field is greater than integer specs and the query bombs when it encounters a number greater than int..

allocation for the nbr field is =12,

unfortunately bigint() is not working

please HELP !!!!!!!!!

THANKS A LOT FOR UR HELP

 
This is what I used to get the job done,

char(number) creates leading '0'to the string to a fixed length, so use a case construction to establish the value of the number and than parse out the correct string using the substr function:

case when number < 10 then .......
when number between 10 and 99 then .....
etc

T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top