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 knock off trailing zero after decimal point

Author  Topic 

DMarmolejos
Yak Posting Veteran

65 Posts

Posted - 2008-07-11 : 10:09:33
I would like to change a 29.00 to 29 by removing the trailing zeros and decimal point.

Any help is appreciated, thank you.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-11 : 10:14:04
1. format it in your front end application where you are displaying the value
2. convert to integer


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2008-07-11 : 11:35:23

select left(value,charindex('.',value)-1)
Go to Top of Page

DMarmolejos
Yak Posting Veteran

65 Posts

Posted - 2008-07-11 : 14:11:55
both ways worked, thank you both.
Go to Top of Page
   

- Advertisement -