Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add dollar symbol to query 1

Status
Not open for further replies.

jundalabee

IS-IT--Management
Nov 19, 2003
35
0
0
Hi,

Is there a way to convert a result in an sql query to include a dollar symbol?

So the number 123456 converted to $123456

Thanks in advance.
 
Make it money type
Code:
SELECT CAST(123456 as money)

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
Microsoft MVP VFP
 
Actually... you need to add the dollar sign by concatenating it to a string.

First, read this: faq183-6157

Now, if you want to add a dollar sign, you must concatenate to do it. Like this...

[tt][blue]
Select '$' + Convert(varchar(20), Convert(Money, 1234567.89),1)[/blue][/tt]

The previous query returns: [green]$1,234,567.89[/green]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks guys, yeah GMMASTROS your solution worked sweet.

Regards,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top