Search code examples
sqlsql-serversql-server-2000

how to round up to decimal place like money


I need to round money values up to the nearest cent, then do some operations on that rounded value. I cannot use Round() because this will also round down. These are all money values.

123.4567 --> 123.46
1.1349 --> 1.14

Is there any way to do this in SQL? If I need a UDF, please provide suggestion on how to accomplish code for that UDF.

EDIT: Data is stored as Float.


Solution

  • CEILING(moneyvalue * 100) / 100
    

    perhaps? Convert to pennies, round up to nearest whole penny, then convert back to dollars.