how to query where date with time = date without time in ms sql
sql-server
Solution
Try like this
SELECT * FROM Bookings WHERE Convert(VARCHAR(10),StartTime,101) = Convert(Varchar(10),'2/15/2014',101)
If you are using SQL SERVER 2012
Try this
SELECT * FROM Bookings WHERE FORMAT(StartTime,'M/dd/yyyy') = FORMAT('2/15/2014','M/dd/yyyy')
SQL FORMAT
Problem
I want to do a query with dates this is my sample tsql: ``` select * from Bookings where StartTime = '2/15/2014' ``` the starttime has value '2/15/2014 12:00:00 AM' when I query where StartTime = date with no time the result is 0 Anybody can help how to do this? thanks