Solved

Can I format ,000 in SQL?

Posted on 2009-07-09
3
482 Views
Last Modified: 2012-05-07
Hi

Select amount from transactions

It shows 5000050

Can it be shown 5,000,050 ?

Can the query be formatted to do it?

I use MSSQL 2005
0
Comment
Question by:techques
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 50 total points
ID: 24814034
DECLARE @v2 DECIMAL (36,10)
SELECT @v2 = 13243543.56565656

SELECT CONVERT(VARCHAR,CONVERT(MONEY,@v2),1) --13,243,543.57
0
 

Author Closing Comment

by:techques
ID: 31601609
excellent! it is exactly what I need
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24820308
glad to help,

Ritesh Shah
www.SQLHub.com
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

680 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