Go Premium for a chance to win a PS4. Enter to Win

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

Can I format ,000 in SQL?

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
techques
Asked:
techques
  • 2
1 Solution
 
RiteshShahCommented:
DECLARE @v2 DECIMAL (36,10)
SELECT @v2 = 13243543.56565656

SELECT CONVERT(VARCHAR,CONVERT(MONEY,@v2),1) --13,243,543.57
0
 
techquesAuthor Commented:
excellent! it is exactly what I need
0
 
RiteshShahCommented:
glad to help,

Ritesh Shah
www.SQLHub.com
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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