I'm querying a SQL Server DB from VB.Net with below command but i cannot get it to select rows from a certain date as the column contains datetime values. It keeps saying
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
I've tried CAST & CONVERT and various date functions but i cant get it to work
CmdText As String = "SELECT * FROM Races m WHERE (RaceStartTime BETWEEN '27/03/2019 00:00:01' AND '27/03/2019 23:59:59') AND RaceTime = (SELECT MIN(RaceTime) FROM Races WHERE DriverName = m.DriverName) ORDER BY RaceTime;"
I'm expecting rows on a given date but im receiving no rows at all. One line of data does have a date on the 27/03/2019 so this should be returned