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 2005 Forums
 Transact-SQL (2005)
 How to add trailing zeros if there is no decimals

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-05-19 : 11:13:02
How can i add two trailing decimals if there is no decimals:

for example if it is just 1, then make it 1.00

if it is 1.12 then leave it as it is.

can you please help.

select cast(ordernumber as varchar(10)) + '00' from ordertable

Thanks for the info.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-05-19 : 11:15:33
select convert(decimal(15,2),1)
Go to Top of Page
   

- Advertisement -