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 -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -