Solved

Convert value to string

Posted on 2013-12-06
4
244 Views
Last Modified: 2013-12-06
I am selecting a number field and need to convert it to 'string' because I have an export function which doesnt work with large numbers, but if I convert to string it should work.

Select number
from table

?
0
Comment
Question by:amucinobluedot
  • 2
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 500 total points
ID: 39701585
What database?  MS SQL Server?  MySQL?

Select cast(number as varchar(15)) from table;
0
 

Author Comment

by:amucinobluedot
ID: 39701606
it is MS SQL 2008

what if the number is larger ?   can I do varchar(150) for example ?
0
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 39701633
Sure you can.  But ... do you really have 150 digits?
0
 

Author Comment

by:amucinobluedot
ID: 39701643
No ... was just saying :)  thx !
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to update the value of duplicated records (except latest one) 2 24
sql server computed columns 11 34
SYbase 4 36
MS SQL Update query with connected table data 3 38
In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question