I have the following values being returned in a column.. 0.250000 and 13.000000. I'd like to round the 0.250000 up to 1 and leave the 13 as is. Any easy way to do this since they both fall within the same column?
Boourns! You fast typer. I'll vote you up if you vote me up ;)
Kieveli
2008-12-15 18:53:17
Sounds like a deal :)
Dave
2008-12-15 18:54:37
+2
A:
The ceiling function will work well because you want to round to the nearest whole number. For more methods on rounding with SQL Server....
G Mastros
2008-12-15 18:53:58
G M - the "nearest whole number" isn't always the next whole number in the sequence. Sometimes a floor() is necessary, depending on the requirements that were evidently left out from the original post.
cLFlaVA
2008-12-15 18:55:44
cLFlaVA,I agree with you. In this particular case, this really isn't rounding, it's a form of truncating. I provided the link for rounding methods in case others stumble across this with an actual rounding question.
G Mastros
2008-12-15 19:04:09
But yes, based on the limited information provided, ceiling would be fine.
cLFlaVA
2008-12-15 19:13:12