?
Solved

upper ceiling

Posted on 2005-04-15
8
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
Comment
Question by:pinaldave
8 Comments
 
LVL 21

Author Comment

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

Accepted Solution

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

Assisted Solution

by:obahat
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Author Comment

by:pinaldave
ID: 13794910
thank you.
0
 
LVL 17

Expert Comment

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

Author Comment

by:pinaldave
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

by:mokule
ID: 13820647
I am around.
0
 
LVL 21

Author Comment

by:pinaldave
ID: 13820666
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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

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.

Join & Ask a Question