April 27, 2011 at 11:16 pm
Hi,
How can I round the number and remove decimal palces in sql server in simple way?
EX:134.678
I need result like this 135
April 27, 2011 at 11:39 pm
Is it something you are looking for?
Declare @int decimal
Set @int = 123345.524
Select ROUND(@int,0)
April 28, 2011 at 12:04 am
kuppurajm (4/27/2011)
Hi,How can I round the number and remove decimal palces in sql server in simple way?
EX:134.678
I need result like this 135
What result do you expect from 134.478?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 28, 2011 at 12:39 am
thank you. It's work fine.
but while I am giving like
select ROUND(16.8712,0) it gives the result like 17.0000
It has been resolved by converting as numeric datatype
April 28, 2011 at 12:06 pm
I like the following.
select floor(convert(decimal(15,8),100.988907))
, convert(decimal(15,8),100.988907)
, ceiling(convert(decimal(15,8),100.988907))
April 28, 2011 at 2:56 pm
ROUND returns the same datatype as the value being rounded. So, if you want a different type (like INT) then you need to CAST it.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply