Ado_p.Connection:=Adoc;
Ado_P.SQL.Clear;
ado_p.SQL.Add('select * from BookRecord where ((卡号=:kh) and (入住时间>= :StartDate) and (入住时间<= :Enddate))');
ado_P.Parameters.ParamByName('kh').Value:=Ed_ddh.Text;
ado_P.Parameters.ParamByName('StartDate').Value :=Startdate.Date;
ado_P.Parameters.ParamByName('Enddate').Value :=enddate.Date;
ado_p.ExecSQL;执行为何显示错误:"标准表达式中数据类型不匹配"请问怎么解决这个问题?谢谢了.
Ado_P.SQL.Clear;
ado_p.SQL.Add('select * from BookRecord where ((卡号=:kh) and (入住时间>= :StartDate) and (入住时间<= :Enddate))');
ado_P.Parameters.ParamByName('kh').Value:=Ed_ddh.Text;
ado_P.Parameters.ParamByName('StartDate').Value :=Startdate.Date;
ado_P.Parameters.ParamByName('Enddate').Value :=enddate.Date;
ado_p.ExecSQL;执行为何显示错误:"标准表达式中数据类型不匹配"请问怎么解决这个问题?谢谢了.
解决方案 »
- tidtcpserver中调用function问题
- 数字操作的一个小问题
- 求一个复合查询的例子(在线等)50分
- 我用delphi写了一个COM+组件,为什么在asp调用的时候出现这样的错误……??
- delphi ppreport打印页数设置问题
- 在DBGrid中对表中的多条记录进行了修改,想把所做的所有修改都撤销,该怎么做?
- 单位工作不多,想找份兼职工作做.希望有需要的能提供机会!
- COM+更新对象无法更新数据,Format '%s' invalid or incompatible with argument
- 呵呵,要换工作了!
- 请问如何改可执行程序的图标?很急!
- 如何把控件的Font属性存到数据库中,以后又从数据库中将其读取,并赋值给控件的Font属性?
- 如何实现对 某 word 文件的读取,并搜索在该文件中的是否存在某个关键字????分不够可以加!!!!!!!!
卡号是什么类型的?是char或varchar么
ado_P.Parameters.ParamByName('Enddate').Value :=enddate.Date;
这两个有问题,你先转为字符串再赋值吧
字段不匹配就看字段类型啊然后把
ExecSQL ---->替换成 sql.open;
看看啊然后把
Execsql替换成sql.open;
问题出在select中有条件时,日期型数据需转换成字符型。