Wednesday, July 28, 2010

How to get only date part in T-sql DateTime

SELECT DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()))

OR

SELECT CONVERT(DATETIME, FLOOR( CONVERT(FLOAT, GETDATE())))

0 comments:

Post a Comment