我做了三层,唯一不同是用本地数据库ACCESS,在查询日期类型出现这个错误:Argument are of the wrong type, Are out of

  • 主题发起人 主题发起人 ansili
  • 开始时间 开始时间
A

ansili

Unregistered / Unconfirmed
GUEST, unregistred user!
我做了三层,唯一不同是用本地数据库ACCESS,在查询日期类型出现这个错误:Argument are of the wrong type, Are out of acceptable rang Or are in conflict with one another.请问什么原因。在线等待,代码如下:(50分)<br />我做了三层,唯一不同是用本地数据库ACCESS,在查询日期类型出现这个错误:
Argument are of the wrong type, Are out of acceptable rang
Or are in conflict with one another.
请问什么原因。在线等待,代码如下:
if date1.Date>date2.Date then
begin

messagedlg('开始时间不能大于结束时间。',mtinformation,[mbOK],0);date1.SetFocus;Exit;
end;
spt:=0;bjt:=0;tt:=0;
decodedate(date1.Date,y,m,d);decodetime(time1.Time,hh,mm,ss,ms);
str1:='#'+inttostr(m)+'/'+inttostr(d)+'/'+inttostr(y);
str1:=str1+' '+inttostr(hh)+':'+inttostr(mm)+':'+inttostr(ss)+'#';
decodedate(date2.Date,y,m,d);decodetime(time2.Time,hh,mm,ss,ms);
str2:='#'+inttostr(m)+'/'+inttostr(d)+'/'+inttostr(y);
str2:=str2+' '+inttostr(hh)+':'+inttostr(mm)+':'+inttostr(ss)+'#';
man.Query2.Close;
man.Query2.CommandText:='select * from sphisx where dd>='+str1+' and dd<='+str2;
showmessage(man.Query2.CommandText);//exit;
man.Query2.Open;
非常急!!!!!!!!!!!!!!!!!!!!!!!!!
 
把时间去掉吧,只要日期就好了.
 
但是我要查询那个时间段的记录吗,怎么办?
 
接受答案了.
 
后退
顶部