Solved

# upper ceiling

Posted on 2005-04-15
Medium Priority
454 Views
Last Modified: 2012-08-14
SET            average_listing = sum_average_listing / fraction

I want to round it... something like ceiling or something. I am not good at SQL.

like average_listing is 2.1 answer should be 3
if 2.9 answer should be 3

Regards,
0
Question by:pinaldave
8 Comments

LVL 21

Author Comment

ID: 13794869
ceiling(sum_average_listing / fraction)   <<< I would have done that in ColdFusion ...
0

LVL 75

Accepted Solution

Anthony Perkins earned 800 total points
ID: 13794880
How about:
SELECT CEILING(sum_average_listing / fraction)
0

LVL 5

Assisted Solution

obahat earned 200 total points
ID: 13794902
Several functions are available for you:

SELECT ROUND(sum_average_listing / fraction)
SELECT CEILING(sum_average_listing / fraction)
SELECT FLOOR(sum_average_listing / fraction)

Look at system functions at books on-line, --> Mathematical functions.

0

LVL 21

Author Comment

ID: 13794910
thank you.
0

LVL 17

Expert Comment

ID: 13794912
if both fraction and sum_average_listing are integers You should convert one of them to float
0

LVL 21

Author Comment

ID: 13820460
Mokule are you around... I was working with this and found the problem you mentioned.
I can still award you 250 points for this Q. Post here and I will post 250 pointer Q to this.
Regards,
---Pinal
0

LVL 17

Expert Comment

ID: 13820647
I am around.
0

LVL 21

Author Comment

ID: 13820666
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differeā¦
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
###### Suggested Courses
Course of the Month13 days, 23 hours left to enroll

#### 807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.