1
votes

I am working with C# Form based application with Access as DB.

And getting this error

Syntax error (missing operator) in query expression 'Request_Data = 12/15/2010 12:00:00 AM AND User_ID = '1''.

On this query.

String sql = "Select * From Requests WHERE Request_Data = 12/15/2010 12:00:00 AM AND User_ID = '1'";

What's wrong in this query?

1

1 Answers

6
votes

I'm guessing you need quotes hashes around the datetime:

String sql = "Select * From Requests WHERE Request_Data = #12/15/2010 12:00:00 AM# AND User_ID = '1'";