Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Floor Function Expand / Collapse
Posted Thursday, April 24, 2008 11:01 PM


Group: General Forum Members
Last Login: Wednesday, February 20, 2013 3:38 PM
Points: 156, Visits: 417
Comments posted to this topic are about the item Floor Function
Post #490413
Posted Friday, April 25, 2008 7:29 AM



Group: General Forum Members
Last Login: Yesterday @ 1:01 PM
Points: 2,639, Visits: 3,197
select floor(13.890) returns 13, but just for fun, here are the results for a couple of variations in SQL 2000 (one difference from SQL 2005 is shown):

select floor('13.890')
(SQL 2005 returns 13, without the trailing .0.)

select floor("13.890")
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name '13.890'.

I thought select floor('13.890') would return an error, but it looks like SQL Server does an implicit conversion from text to number type in order to allow the calculation.


"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Post #490647
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse