1

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 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

3 Comments

Request_Data is of Date/Time datatype and don't require quotes. Though I have tried it and it give incorrect datatype error.
Perhaps #12/15/2010 12:00:00 AM# instead.
It would be great if you edited your answer to show the correct answer, that is, with hash (#) not quotes (').

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.