5,930
社区成员
发帖
与我相关
我的任务
分享uses dateutils;
var
d1,d2:TDateTime;
Begin
if StrToInt(Edit2.Text)=1 then
d1:=Encodedate(StrToInt(Edit1.Text),12,21);
else
d1:=Encodedate(StrToInt(Edit1.Text),StrToInt(Edit2.Text)-1,21);
d2:=Encodedate(StrToInt(Edit1.Text),StrToInt(Edit2.Text),20);
ADOQuery1.SQL.Text:='select * from t where riqi between '''+DateToStr(d1)+''' and '''+DateToStr(d2)+'''';