Answered by:
How to eliminate digits after decimal point

Question
-
I have data like
2,000,000.00
0.00
1,884,977.00
10,825,354.00
1,615,880.00
3,226,841.00
0.00
4,832,814.00I dont want to present 00 after decimal point.
2,000,000
0
1,884,977
10,825,354
1,615,880
3,226,841
0
4,832,814I want present data like this ..Please suggest how to eleminate those zeros..
Monday, June 21, 2010 1:01 PM
Answers
-
use cast function to avoid decimals
Select cast(sal as decimal (10,0)) from emp
- Proposed as answer by sekhara shiris chinta Monday, June 21, 2010 1:42 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 1:07 PM -
If that data is a string you could do this:
select Left(YourColumName,Len(YourColumName)-3) from dbo.tableName
Seth
http://lqqsql.wordpress.com- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 2:36 PM -
Hi,
Try with the following query.
Select REPLACE(colname,'.00', '' from tblname
------------------------
Thanks,
RajaSekhar Reddy . K
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 4:45 PM
All replies
-
use cast function to avoid decimals
Select cast(sal as decimal (10,0)) from emp
- Proposed as answer by sekhara shiris chinta Monday, June 21, 2010 1:42 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 1:07 PM -
If that data is a string you could do this:
select Left(YourColumName,Len(YourColumName)-3) from dbo.tableName
Seth
http://lqqsql.wordpress.com- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 2:36 PM -
Hi,
Try with the following query.
Select REPLACE(colname,'.00', '' from tblname
------------------------
Thanks,
RajaSekhar Reddy . K
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 16, 2013 5:11 PM
Monday, June 21, 2010 4:45 PM