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
 General SQL Server Forums
 New to SQL Server Programming
 Add dollar to the result of floor value

Author  Topic 

vignesht50
Yak Posting Veteran

82 Posts

Posted - 2014-10-06 : 07:35:12
Hi,

I am using this query to get the nearest value and rounding it.

floor(Price*DollarPrice) as Dollars

This returns result like below

31
34
567

Now I just need to add dollar symbol before the result. Please suggest me.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-06 : 08:02:00
select '$' + cast(floor(Price*DollarPrice) as varchar(50)) as dollars

BUT, you really should do the formatting in the presentation layer, not in SQL
Go to Top of Page
   

- Advertisement -