Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Convert value to string

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
Aleks
Asked:
Aleks
  • 2
  • 2
1 Solution
 
Daniel WilsonCommented:
What database?  MS SQL Server?  MySQL?

Select cast(number as varchar(15)) from table;
0
 
AleksAuthor Commented:
it is MS SQL 2008

what if the number is larger ?   can I do varchar(150) for example ?
0
 
Daniel WilsonCommented:
Sure you can.  But ... do you really have 150 digits?
0
 
AleksAuthor Commented:
No ... was just saying :)  thx !
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now