TSQL - How to get the date element of a datetime object
SELECT CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,GETDATE())))I would probably have done it via a CONVERT/CAST operation, converting to a VARCHAR and then back to a DATETIME, but this is a much more efficient method.In SQL Server 2008 there is a DATE data type so this will no longer be an issue.