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

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -