Solved

Convert value to string

Posted on 2013-12-06
4
242 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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