Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Querying datetime column by date
Message
 
 
To
18/02/2011 10:26:37
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01500708
Message ID:
01500717
Views:
49
>Thanks, Naomi
>That looks good.
>I found this too- it strips the time off
>:
> CAST(FLOOR(CAST(mydatetimecolumn AS float))AS datetime)

I don't know where you found it, but forget it right away. Don't ever try to use function on the field - it will make your query non-sargable.

Please make sure to read the short blog by Aaron Bertrand I referenced (the second reference).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform