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
 Transact-SQL (2000)
 Convert Integer -

Author  Topic 

cindylee
Yak Posting Veteran

55 Posts

Posted - 2005-02-06 : 22:22:32
hi guys,
I have a column a (integer datatype)
Ex: a
---------
3500
12345
4597
0
result i want
$35.00
$123.45
$45.97
$0
I tried converting to decimal and float but no luck.
any help much appreciated
Cindy

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-06 : 23:03:25
select '$' + case when a = 0 then '0' else convert(varchar(20),convert(money, 1.0 * a / 100)) end
from tbl



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

cindylee
Yak Posting Veteran

55 Posts

Posted - 2005-02-07 : 18:21:45
it works..thanks nr
cindy
Go to Top of Page
   

- Advertisement -