07

Jan

2011

Date only in SQL

In many case, you might want to get the date only out of table with time, here is the simple way to achieve it:

 

DATEADD(dd, 0, DATEDIFF(dd, 0, <DateColumn>)) = ‘2011-01-07’

or

DATEADD(dd, 0, DATEDIFF(dd, 0, GetDate())) = ‘2011-01-07’

Comments are closed.