I am developing an application with an Access DB, and i'm having trouble retrieving data from the db, i want to count how many operations have been made through two dates that i'm passing from a datetimepicker, and i can't manage to do it, since i keep getting an error saying "Data type mismatch in criteria expression". In the db, i have that date field type as a date. Before, i had it as a text, but it wouldn't work if i selected one date of x month and the other date from a different month.
So, my question is, how do i indicate the type of data in the sql query?
My code is the following:
Dim cmdtotalsei As New OleDb.OleDbCommand("select count(cod_seizure) from seizure where seizure_date between '" & DateTimePicker1.Text & "' and '" & DateTimePicker2.Text & "'", conn)
All help will be appreciated. Thank you!