string intime1 = this.intime1.Text.Trim();
string intime2 = this.intime2.Text.Trim();
sql = "select * from info where title like'%" + title + "% and intime between '" + intime1 + "' and '" + intime2 + "' order by id desc";
错误提示“标准表达式中数据类型不匹配”不知是什么原因?我用的是ACCESS,intime字段设置为日期格式。请教高手,谢谢!!
string intime2 = this.intime2.Text.Trim();
sql = "select * from info where title like'%" + title + "% and intime between '" + intime1 + "' and '" + intime2 + "' order by id desc";
错误提示“标准表达式中数据类型不匹配”不知是什么原因?我用的是ACCESS,intime字段设置为日期格式。请教高手,谢谢!!
sql = "select * from info where title like'%" + title + "% and intime between #" + intime1 + "# and #" + intime2 + "# order by id desc";
string intime2 = this.intime2.Text.Trim();
sql = "select * from info where title like '%" + title + "%' and intime between #'" + intime1 + "'# and #'" + intime2 + "'# order by id desc";
日期的语法错误 在查询表达式 title like'%%and intime between #''# and #''#' 中。
sql 把它拿出来,看看,到Access里试试!不是知道,那错了吗啊?
上面的那个表达式是调试得到的sql语句吗?如果是,肯定错了 在access中不是用+,而是@
sql = "select * from info where title like'%" @ title @ "%' and intime between '" @ intime1 @ "' and '" @ intime2 @ "' order by id desc";
用这个试试看
string intime2 = this.intime2.Text.Trim();
===============
是这个地方出错了吧,
检查一下读出的intime1和intime2是多少?