Solved

Convert value to string

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short film showing how OnPage and Connectwise integration works.

914 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now