Solved

Convert value to string

Posted on 2013-12-06
4
240 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
Comment Utility
What database?  MS SQL Server?  MySQL?

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

Author Comment

by:amucinobluedot
Comment Utility
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
Comment Utility
Sure you can.  But ... do you really have 150 digits?
0
 

Author Comment

by:amucinobluedot
Comment Utility
No ... was just saying :)  thx !
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

11 Experts available now in Live!

Get 1:1 Help Now