I gotta be missing something obvious.
select CEILING(85/30) = 2
85/30 = 2.83333
I want the value to be 3.
Shouldn't the CEILING function round up for me?
Try
SELECT CEILING(85.0/30)
And for comparison
SELECT 85.0 / 30, 85 / 30
The first example uses floats, the second uses ints, so the result is rounded before the ceiling function is hit. What you do is
SELECT CEILING(2)
Rather than
SELECT CEILING(2.833333)
Change it for :
select CEILING(85/30.0)
INT / INT yields an INT, so 85/30 rounds it down (FLOOR).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With