Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Converting Number to String With Decimal Points

Posted on 2009-05-20
3
Medium Priority
?
1,420 Views
Last Modified: 2012-05-07
Hi experts
     I'm need convert number data type to string but i need convert with decimal points.
Example when i convert '100.000,00' (number) field to string it seems like '10000000'(str) but i need '100.000,00'(str)
0
Comment
Question by:nwncys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:venkatca
ID: 24429580
Is this what you are looking for?
declare @value decimal(12,2)
set @value=100000
select cast(@value as varchar(12))

Open in new window

0
 
LVL 1

Expert Comment

by:venkatca
ID: 24429628
If you need further formatting with commas, etc, there is an article in this site which discusses the same.

http://www.codeproject.com/KB/database/SQLPhoneNumbersPart_2.aspx
0
 
LVL 12

Accepted Solution

by:
Dimitris earned 1000 total points
ID: 24429727
here u r

You have to convert your decimal field to money and after that to string
see this sample
declare @MyValue as decimal(18,2)
SET @MyValue = 100000.00
 
SELECT CONVERT(nvarchar,cast(@MyValue as money),1)

Open in new window

0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 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