Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Format query result to currency

Author  Topic 

eponcedeleonc
Starting Member

4 Posts

Posted - 2011-08-11 : 17:37:09
i have a simple query where I make the sum of multiple colums... However I want to format my result to $999,999,999.99. How can I do this...

this is my query.

SELECT SUM ("JUN_F1"."Renta"+"JUN_F1"."Servicios"+
"JUN_F1"."TAN"+"JUN_F1"."LDN"+"JUN_F1"."TARN"+"JUN_F1"."LDRN"+
"JUN_F1"."TARI"+"JUN_F1"."LDRI"+"JUN_F1"."Paquete_RI") AS Amount
FROM
public."JUN_F1";

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-11 : 18:25:49
This is a presentation issue and should be handled in your application and not inside SQL.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-12 : 02:31:21
you can do this very easily in your application by using format functions. In SSRS, you already have some standard currency formats or even can give custom expression like ="$###,###,###.#0"

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -