I have a user interface where I want to filter a datagridview.. I 've achieved to create filters but I 've failed to filter tha data by date.. I have a sql db and the column of date is of datetime type. When I try to filter the data by choosing a date in a datetimepicker I use this query:
If TodayToolStripMenuItem.Checked = True Then query = "Select * from INCIDENTS where DateReported='" & dtpEqualTo.Value.Date & "'"
The problem is that when I run the project I take the message "The conversion of a varchar type to a datetime data type resulted in an out of range value"