Collections:
FLOOR, CEILING, ROUND - Converting Values to Integers in SQL Server
How To Convert Numeric Values to Integers in SQL Server Transact-SQL?
✍: FYIcenter.com
Sometimes you need to round a numeric value into an integer. SQL Server 2005 offers you a number of ways to do this:
The tutorial exercise below gives some good examples of converting numeric values to integers:
SELECT FLOOR(1234.5678); SELECT CEILING(1234.5678); SELECT ROUND(1234.5678, 0, 0); SELECT CAST(1234.5678 AS INT); SELECT CONVERT(INT, 1234.5678); GO 1234 1235 1235.0000 1234 1234
Â
⇒Numeric Expressions and Functions in SQL Server Transact-SQL
2017-03-22, 4128👍, 0💬
Popular Posts:
Where to find answers to frequently asked questions on INSERT, UPDATE and DELETE Statements in MySQL...
How To List All User Names in a Database in SQL Server? If you want to see a list of all user names ...
How To Display a Past Time in Days, Hours and Minutes in MySQL? You have seen a lots of Websites are...
How To Replace Given Values with NULL using NULLIF() in SQL Server Transact-SQL? Sometime you want t...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...