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)
 How to show 17.1 as 17.10 in a view?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-14 : 08:57:14
fxb writes "Is there a way in SQL to set up a view that will show 17.1 as 17.10 (I want the decimals to be aligned)? For example:

BEFORE -> AFTER
25.01 as 25.01
17.1 as 17.10
2.6 as 22.60
1.1 as 1.10
10.22 as 10.22

Thanks for your help.

FXB

SQL Server 8.0
Windows XP"

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-14 : 09:01:59
convert(decimal(7,2),mycol)


==========================================
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

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-07-14 : 09:03:18
declare @a decimal(8,1)
set @a = 17.1
Print @a
print convert(decimal(8,2), @a)

Srinika
Go to Top of Page

humanpuck
Yak Posting Veteran

94 Posts

Posted - 2006-07-14 : 09:05:13
select convert(decimal(5,2),1.10)
Go to Top of Page
   

- Advertisement -