Solved

Can I format ,000 in SQL?

Posted on 2009-07-09
3
476 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

705 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

19 Experts available now in Live!

Get 1:1 Help Now