Data type mismatch when retrieving records from an access database using a DateTimePicker
Posted
by Daniel
on Stack Overflow
See other posts from Stack Overflow
or by Daniel
Published on 2010-03-23T11:05:46Z
Indexed on
2010/03/23
11:23 UTC
Read the original article
Hit count: 670
I get a Data type mismatch criteria expression error when i try to retrieve records from an access database between two dates using a DateTimePicker in C#.
This is the Select statement
else if (dtpDOBFrom.Value < dtpDOBTo.Value)
{
cmdSearch.CommandText = "SELECT [First Name], [Surname], [Contact Type], [Birthdate] FROM [Contacts] WHERE [Birthdate] >= '" + dtpDOBFrom.Value +"' AND [Birthdate] <= '" + dtpDOBTo.Value +"'";
}
© Stack Overflow or respective owner