April 17, 2004 at 4:56 pm
Is there a way to format a money value into a standard currency string with commas & dollar sign?
Kurt
April 18, 2004 at 11:48 pm
There's probably a really elegant way of doing this. This isn't it, but it works
select '$' + convert(varchar(30), cast(amount as money),1) as Formatted_Cash ...
replacing 'amount' with the field you want to format.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
April 19, 2004 at 7:10 am
Thanks that works great.
April 19, 2004 at 7:57 am
Why don't you use your front-end for such formatting stuff? That shouldn't be the job for the server.
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
September 1, 2004 at 3:10 pm
The front end shoud not always be used for formatting. If you are using ADO.NET datasets and connecting them directly to an ASP.NET DataGrid, you don't want to have to edit the dataset. Such a formatting statement in a stored procedure is much more efficient.
Fred Peters
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply