I am using a not equal operator <> in my sql statement but it doesn’t retrieve any record which is not equal to the selected date.
CODE:
Command = New SqlCommand("SELECT * FROM [Products] WHERE [ParkingStartDate] <> @StartDate", myConn)
Command.Parameters.AddWithValue("@StartDate", StartDate1)
This won’t return anything if either of the following is true:
StartDate1is aNULLParkingStartDatefor all values is aNULLor equal toStartDate1(obvious one)Check that you are passing a non-
NULLvalue inStartDate1and there are records satisfying your condition.