SQLTeam.com | Weblogs | Forums

Round up

What function do I need to use that would round everything up 2 decimals

.013=02
.011=.02
0.16=.02
0.222=.23
and etc

ceiling rounds to the first digit.

Try:
ROUND(, 2).

That uses the basic round principles 5 or greater round up. 4 or less round down.

Standard trick for rounding up:

ROUND( value + 0.005, 2 )

Or, in SQL Server:

ROUND ( value + 0.009, 2, 1)

That worked, ROUND ( value + 0.009, 2, 1) or ROUND ( '.013' + 0.009, 2, 1)=.020 . Not sure why. How does the 1 as the operation make the math work?

The 1 (or any value) makes it truncate rather than rounding up. For example:

SELECT ROUND(1.9999, 2, 1), /* vs */ ROUND(1.9999, 2)

Lookup the function. It's got some other tricks to it.