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.
Author |
Topic |
mistylove98
Starting Member
5 Posts |
Posted - 2015-04-14 : 12:12:02
|
I have a query where I have to use the convert function to return the unitprice as a decimal with 2 digits to the right of the decimal and a $ to the left of the number like 10 should be $10.00 Can anyone tell me how do i insert the $ this is my code so farSELECT CONVERT(varchar, UnitPrice, 1) AS varchartotalFROM dbo.[Order Details] |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2015-04-14 : 12:27:01
|
See CAST and CONVERT in Books Online (the SQL Server help file). Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
Maithil
Starting Member
29 Posts |
Posted - 2015-04-15 : 05:37:02
|
Hi,You can Use any one from below two select statementselect '$'+cast(CAST(10 as money) as nvarchar)-----------select '$'+CAST(Convert(money,10) as nvarchar) |
|
|
|
|
|