itsaboutcode
itsaboutcode

Reputation: 25099

Syntax error (missing operator) in query expression

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?

Upvotes: 1

Views: 6687

Answers (1)

thirtydot
thirtydot

Reputation: 228132

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'";

Upvotes: 7

Related Questions