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’
sharing is caring
January 7, 2011
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’
© 2024 Paul Gu | Blog
Theme by Anders Norén