sql server 2012 - Compare only DATE from 2 datetime columns - sql -
how can code compare date (not time) 2 different columns storing date in 2015-01-10 01:20:00 format? example.
select * admissions admitdatetime = departdatetime
above try compare 2015-01-10 01:20:00 2015-01-10 01:20:00 instead of date 2015-01-10 2015-01-10. please. thanks.
another way:
select * admissions datediff(dd,admitdatetime,departdatetime)=0
Comments
Post a Comment