How to round up any number.
Create function :
CREATE FUNCTION dbo.RoundUP(@Value float )RETURNS int AS
BEGIN
DECLARE @Result int
SELECT @Result = ROUND(@Value,0)
IF @Result < @Value SET @Result = @Result + 1 RETURN @Result END Test :
select dbo.RoundUp(124.000001) as result
Result :
Subscribe to:
Post Comments (Atom)
4 comments:
Works great and it's clear.
Thanks
Just a tip you can use the MS SQL function 'Ceiling' to do a very similar thing (which was easier in my case)
Thanks for the tip!
Thanks so much, James :) that is esiest way.
I've never known before.
I just use sql function which I know and I could't find any solution.
Easiest way.
SELECT CEILING(20.0001 )
Result is 21
Post a Comment