Hi.
Here's the problem.
I use C# application [forms] to access MSAccess database.
I want to get id's of all records containing some phrase and order results by date (a field in the table).
here's the code:
OleDbCommand cmd = new OleDbCommand("s elect id, endDate from audits where objectId ='" + (int)data[0] + "' order by endDate DESC", conn);
try
{
conn.Open();
OleDbDataReader aReader = cmd.ExecuteRead er(); <-- here i get error*
}
(...)
* error: "Data type mismatch in criteria expression"
If I delete '+ "' order by endDate DESC' part of the query it works.
How to order my results by date?
Here's the problem.
I use C# application [forms] to access MSAccess database.
I want to get id's of all records containing some phrase and order results by date (a field in the table).
here's the code:
OleDbCommand cmd = new OleDbCommand("s elect id, endDate from audits where objectId ='" + (int)data[0] + "' order by endDate DESC", conn);
try
{
conn.Open();
OleDbDataReader aReader = cmd.ExecuteRead er(); <-- here i get error*
}
(...)
* error: "Data type mismatch in criteria expression"
If I delete '+ "' order by endDate DESC' part of the query it works.
How to order my results by date?
Comment