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

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -