April 24, 2008 at 11:01 pm
Comments posted to this topic are about the item Floor Function
April 25, 2008 at 7:29 am
[font="Courier New"]select floor(13.890)[/font] returns [font="Courier New"]13[/font], but just for fun, here are the results for a couple of variations in SQL 2000 (one difference from SQL 2005 is shown):
[font="Courier New"]select floor('13.890')[/font]
13.0
(SQL 2005 returns [font="Courier New"]13[/font], without the trailing [font="Courier New"].0[/font].)
[font="Courier New"]select floor("13.890")
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name '13.890'.[/font]
I thought [font="Courier New"]select floor('13.890')[/font] 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
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply