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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -