T-SQL: How to get only Date from DateTime?
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
Here is how you can get time only from a DateTime field:
SELECT DATEADD(day, 0, -DATEDIFF(day, 0, GETDATE()))
Posted on January 3, 2008 by Viktar Karpach