23 April 2010

Get only the date part of a DATETIME

To get only the date part of a DATETIME on an efficient manner use the following code:


CAST(FLOOR( CAST( GETDATE() AS FLOAT )) AS DATETIME)

No comments: