var st,en:TDateTime;//分别定义起止日期 st:=strtodate(combobox1.Text+'-'+combobox2.Text+'-'+combobox4.Text); en:=strtodate(combobox5.Text+'-'+combobox6.Text+'-'+combobox7.Text); //转换从combobox输入的日期 with query1 do begin active:=false; close; sql.Clear; sql.Add('select * from tela where name=''+edit1.Text+'' and stdate between:st and :en order by stdate,startt asc'); //stdate为数据库里日期的字段名。名字符合条件,并且在界定的起止时间内的记录,并按时间排序。 open; active:=true; end;
这个代码编译通过,但在运行时会有这样的错误: query1:Field 'st' is of an unknown type. 敢问各位高手该如何解决?谢谢!!
----------------------------------------------
我从迷茫中走来,希望能清晰地离去