2
I’m making a SUM(x)
and I need to divide it by 8
, for this example, my result will be 5.5
.
The result needs to be like an INT and rounded up.. So for this example, I need the result 6
.
I’ve already tried:
ROUND(SUM(x)/8,0)
> I obtained 5
ROUND(SUM(x)/8,-1)
> I obtained 10
CEILING(SUM(x)/8)
> I obtained 5
I’m doing this, the result of the SUM of the 44:
SELECT ROUND(SUM(x)/8,0) FROM Tabela
If you do it with the direct value, it rounds right:
SELECT ROUND(44/8,0) FROM Tabela
But I need it to be with SUM!
CEILING ( numeric_expression )
should work. https://docs.microsoft.com/pt-br/sql/t-sql/functions/ceiling-transact-sql?view=sql-server-2017– edson alves
Like I said, I’ve tried..
– LeoHenrique