DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Remove Time From A SQL Date
Convert a SQL date time into a date, aka, remove time from a SQL date
-- fast way that relies on the internal data structure SELECT CAST( FLOOR( CAST( GETDATE() AS FLOAT ) ) AS DATETIME ) AS date_only -- slower way that does not rely on internal data structure SELECT CONVERT( DATETIME, CONVERT( NCHAR(10), GETDATE(), 126 ) ) AS date_only





