Saturday, January 8, 2011

Removing time from an sql datetime value

The following trick can be used to remove (set it to zero) time from an sql datetime value.

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

0 comments:

Post a Comment