SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera SQL Check

Exploring CEILING, FLOOR, and ROUND

This lesson is a basic introduction to the TSQL functions that you can use for rounding numeric values. ROUND provides the traditional result we learned in school (with one odd option you might not expect), and CEILING and FLOOR allow us to easily round up or down without regard to whether a value is over or under the ".5" rounding point. Good basic stuff, but stuff you'll find occasion to use quite a bit.

Duration:
2 mins 58 secs
Skill Level:
100
Rating:
4.28 out of 5
Publish Date:
November 20, 2010
Exploring CEILING, FLOOR, and ROUND You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
Jamshid Nouri on 11/24/2010
excellent demo

Sainey M. Drammeh on 11/24/2010
Excellent, thanks.

Todd Burrell on 11/24/2010
Great stuff. Combine yesterday Rand lesson with Round and you can easily get a random integer between 0 and whatever (here, 1000) SELECT ROUND( RAND() * 1000, 0)

Nilesh on 11/24/2010
nice

Charlie Bruno on 11/24/2010
Nice usage and combining of a few functions Todd. Good demo.

Rajiv Gupta on 11/24/2010
Very good!!!

Tahir A. Syed on 11/24/2010
Thanks

Trent on 11/24/2010
good examples and easy to follow.

Cary on 11/24/2010
Elegant explanation. Thanks.

Sara Karasik on 11/24/2010
Great presentation, clear. BUT - the content was too simple. I like to learn things that I don't know, not review basics.

Stan Griffin on 11/24/2010
Good little demo. I was curious about ROUND(9.5, 0)

Kenneth Wymore on 11/24/2010
Quick and concise with good samples.

Boyd Petrie on 11/24/2010
Discussing ROUND without discussing data types seems like an incomplete job. ROUND with a float or decimal and show that sometimes you will get an unexpected result (9.0000000124).

Jack Pines on 11/24/2010
The video was washed out (dimmed) on my viewing today.

Raymond Zayas on 11/24/2010
Excellent. Thank you for sharing.

Dallas on 11/24/2010
How does the t-sql round function compare with that of C# (.net 3.5 specifically), because it uses midpoint rounding.

kalapala baburao on 11/24/2010
good

AI LIN SENG on 11/25/2010
Help, how to round to a whole number with an ending number either 0 or 5 only???

WChaster on 11/30/2010
When using the ROUND function and specitying a value like you did of 1 or 0, when there is more the decimal places; does the result show all the decimal places? That does not appear to be a true result to me.

Faisal Lodhi on 12/2/2010
Nice

Marshall Cole on 12/9/2010
Awesome!!!!!!!!!!!!!!!!!!!!!!! The best Professional to learn from today date. I really like thie gentlemen in this vidwo, as I have learned so much from him. He is very clear an concise with his teachings and voice instructions. Thank you for taking the time to help us improve.

B60C5F1F21 on 12/13/2010
Yes, this does select ROUND(9.99,0) --answer Arithmetic overflow error converting expression to data type numeric. instead of 10

Maurice Ivory on 6/3/2011
It was okay, but I guess I don't have enough experience yet to see where I would use these functions.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions