Links

 

MSSQL: Stripping a DATETIME Value of its Time Value

Stripping a DATETIME value of its time element has been the one thing in SQL that I've had to do at every job. Yet I always forget how to do it. This method here is by far the simplest, and also the fastest way of doing it, that I've come up with.
SELECT CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME)
Submit a comment, suggestion, or additional information about this snippet
If you login or register, you'll be able to post a comment or provide feedback about this snippet.
Contact Us | Terms of Use