Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Querying datetime column by date
Message
 
 
À
18/02/2011 10:26:37
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01500708
Message ID:
01500717
Vues:
48
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform