这个查询为什么查询不到结果?
delphi吧
全部回复
仅看楼主
level 7
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
s:='select * from 治疗费用信息 where'+
' 费用产生时间>=:'+#39+formatdatetime('yyyy/m/d',dtp1.Date)+#39+
' and 费用产生时间<=:'+#39+formatdatetime('yyyy/m/d',dtp2.Date)+#39;
ShowMessage(s);
ADOQuery1.SQL.Add(s);
ADOQuery1.Open();
dtp1和dtp2是DateTimePicker控件
2015年03月02日 16点03分 1
level 13
6rl
你加个冒号作甚哦
2015年03月02日 23点03分 2
加冒号不报错,不加一编译就报错了!
2015年03月03日 04点03分
6rl
@[email protected] 这么奇怪的事情,我在delphi7 编译没问题啊,运行也没问题(没执行open)
2015年03月04日 01点03分
吧务
level 14
运算符的优先级问题
2015年03月03日 00点03分 3
什么意思?
2015年03月03日 04点03分
@[email protected] 请看入门书。and前后的表达式最好加上括号。
2015年03月03日 05点03分
level 4
格式强调下:
with adoquery1 do
begin
close;
clear;
sql.add('sql');
open;
end;
2015年05月15日 02点05分 4
1