views:

379

answers:

3

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?

+2  A: 

Your DBMS probably has a CEILING function. Try that.

Dave
Boourns! You fast typer. I'll vote you up if you vote me up ;)
Kieveli
Sounds like a deal :)
Dave
+1  A: 

select CEILING( columnname ) from tablename

Kieveli
+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....

SQL Server Rounding Methods

G Mastros
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
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
But yes, based on the limited information provided, ceiling would be fine.
cLFlaVA