Actually, I am quite aware of the great range of mathematics, but even advanced mathematics is based on elementary (not school) principles.
And Achilles will over take the tortoise; its physics, not philosphy.
Sergiy,
Its do bad your only arguments are attacks on other peoples education, experience, and beliefs. You would do better to provide specific facts and citiations to support your arguments rather than the attacks you make on people. They are constant, demeaning, and do nothing to support your arguments.
Why not try being constructive and supportive instead of these continuous attacks. Of course, the answer is simple; you are always right even when you have been proved wrong with specific facts and tests that you yourself purposed but never accepted.
I think we all finally learn when to stop banging our heads against the brick wall.
I have not found any function in SQL Server 2005 to peform bankers rounding.
You do have one in the Dot Net Framework
CREATE FUNCTION dbo.RoundBanker (@val decimal(38,12), @pos int)RETURNS decimal(38,12)as -- Takes two parameters. First is number to be rounded, second is how many places to round to---------------------------------------------------------------------------------------------begin declare @tmpval1 bigint, @tmpval2 decimal(38,12), @retval decimal(38,12), @tmpval3 decimal(38,12), @tmpval4 decimal(38,12), @predec decimal(38,12), @postdec decimal(38,12) -- To get most from function, ignore everything before decimal point -------------------------------------------------------------------- set @predec = floor(abs(@val)) set @postdec = case sign(@val) when 1 then @val - @predec else @val + @predec end -- Actual work (Lynn's) ---------------------- set @tmpval1 = floor(abs(@postdec) * power(cast(10 as float), @pos)) set @tmpval2 = round(@postdec, @pos, 1) set @tmpval3 = sign(@postdec) * (0.5 * power(cast(10 as float), (-1 * @pos))) set @tmpval4 = (@postdec - @tmpval2) set @retval = round(@postdec, @pos, case when nullif(@tmpval1, (@tmpval1 / 2) * 2) is null and ((@tmpval3 >= @tmpval4 and sign(@val) = 1) or (@tmpval4 >= @tmpval3 and sign(@val) = -1)) then 1 else 0 end) -- Rebuild number ----------------- select @retval = case sign(@val) when 1 then @retval + @predec else 0.0 - @predec + @retval end return @retvalend