The CEILING Function

Fear Naught

Kevin
Local time
Today, 23:57
Joined
Mar 2, 2006
Messages
229
In Excel the CEILING function allows a parameter to determine the level at which you want the result. An example is CEILING(123.4,5) would result in 125. The effect being the expression is pushed to the next integer divisible by 5. If I had put CEILING(123.4,10) then the result wouldhave been 130.

In SQL the CEILING Function does not allow that parameter and only pushes the expression to the next integer. In my example the the result of CEILING(123.4) would be 124.

What I am doing is querying my parts table and increasing prices by a percentage but I want the result rounded up to the nearest £5 which I can do in Excel but need to be able to do it in SQL so that I can run an update query to update the prices.

Can anybody help please?
 
Hi there

Check the t-sql round function in BOL
 

Users who are viewing this thread

Back
Top Bottom