C#查找Access指定日期的数据
首先我Access数据里面AuditTime字段都是时间日期格式,值是“2012/12/12”
string bomSql = @"select * from [目录] where AuditTime ='2012-12-12'";
DateTime dt = DateTime.Parse("2012-12-12");
string bomSql = @"select * from [目录] where AuditTime ='" + dt + "'";
查询过程中都提示“标准表达式中数据类型不匹配。”这个要怎么写呢?
------解决方案--------------------string bomSql = @"select * from [目录] where AuditTime ='" + dt + "'";
=>
string bomSql = @"select * from [目录] where AuditTime =" + dt + "";