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 2000 Forums
 SQL Server Development (2000)
 money conversions

Author  Topic 

sunbeam
Starting Member

8 Posts

Posted - 2004-08-17 : 08:32:54
i have a column with numbers to store price info.

is there any way in sql to add commas and a dollar sign to these numbers,(eg, $45,786.21)
tried cast and convert but did not work , except rounding off the number to nearest number.

any suggestions
-thanks

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-08-17 : 08:35:15
No. Do this in the application. It's a formatting issue. You can do it in SQL, but that would be ridiculous.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-08-18 : 06:42:27
The application could issue the following select:
( Maybe QA is the client application ? )

/*1 is the format flag for convert monetary data*/
SELECT '$' + CONVERT(VARCHAR(25),CAST(45786.21 AS MONEY),1)

/rockmoose
Go to Top of Page
   

- Advertisement -