D
didi413
Unregistered / Unconfirmed
GUEST, unregistred user!
在两个DateTimePicker控件,将他们的kind属性都先设为dtkdate,然后在查询事件中写如下代码:
var date1,date2,date3,date4:string;
...
begin
date1:=datetostr(datetimepicker1.Date);
date2:=datetostr(datetimepicker2.Date);
with query1 do
begin
close;
SQL.Clear;
SQL.Add('select * from yourtablename ');
SQL.Add('where fieldname between #'+date1+'# and #'+date2+'#');
Open;
end;
....
这样是可以的,但是将kind属性都设为dtktime,
date3:=timetostr(datetimepicker3.time);
date4:=timetostr(datetimepicker4.time);再执行上面的SQL语句时就报错。
(Parameter 不正确被定义。提供不一致或不完整的内容)
DELPHI6.0+Access2000下。为什么?
var date1,date2,date3,date4:string;
...
begin
date1:=datetostr(datetimepicker1.Date);
date2:=datetostr(datetimepicker2.Date);
with query1 do
begin
close;
SQL.Clear;
SQL.Add('select * from yourtablename ');
SQL.Add('where fieldname between #'+date1+'# and #'+date2+'#');
Open;
end;
....
这样是可以的,但是将kind属性都设为dtktime,
date3:=timetostr(datetimepicker3.time);
date4:=timetostr(datetimepicker4.time);再执行上面的SQL语句时就报错。
(Parameter 不正确被定义。提供不一致或不完整的内容)
DELPHI6.0+Access2000下。为什么?