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
Author
Message
Posted Thursday, April 24, 2008 11:01 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

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


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:20 AM
Points: 2,373, Visits: 2,726
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')
13.0
(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.

Thanks,
webrunner


-------------------
"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?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #490647
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse