Tell me how to round the number in a big way? Does the sql function similar to the function from C# Math.Round(value, MidpointRounding.AwayFromZero);
Those. if I have 7.5 , I should get 8 , but if I have 7.4 , I should get 7 .

  • Try adding 0.5 to the number before rounding. - Dmitry D.
  • You mean, rounding off with round? - Pyrejkee
  • select round (5.4, 0); // get 5 select round (5.5, 0); // get 6 - user190134
  • Does not work, if separated by a comma 0 - Pyrejkee
  • one
    7.5 rounded to large to 8 from 0 sqlfiddle.com/#!9/358781/1 - Xramovnic

2 answers 2

select round (7.5, 0) from dual

  • I tried your option, in Management Studio, it really works. But in Access, for some reason, this trick does not work. - Pyrejkee
  • @ PyrejkeePureshkin specify in the tags to the question what kind of DBMS do you use. In Access, the round function performs banking rounding, about which I wrote in the comments. - teran
  • Well, take note. I thought the SQL language is unified. - Pyrejkee

In Access, you can do this:

 SELECT round(x+0.05,0)