简体   繁体   中英

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?

我猜您需要在日期时间前后加上 引号 哈希:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM