最近用Delphi sql 做毕业设计,有一个统计做起来有点问题 开始时间 edit1
截止时间 edit2
统计(button)
时间段内建设个数 edit3 edit1,edit2都是用户要输入的时间,,button是统计按纽.
对SQL内容进行统计,希望统计到时间段内建设项目的个数,并将结果显示在edit3中,我用的是ADOQuery,用的SQL语句是
select count(*) as count from tabel where 建设时间>='edit1.text' and 建设时间<'edit2.text'
button(统计)用的语句是
adoquery1.close;
adoquery.sql.clear;
adoquery.sql.add('select * from tabel where 建设时间>='edit1.text' and 建设时间<'edit2.text'
');
adoquery1.open;
Edit3.Text:=IntToStr(adoquery1.RecordCount);
end;
可就是没法显示在edit3中,不知道是哪里出现了问题,希望各位路过的高手帮帮忙,谢谢了~
截止时间 edit2
统计(button)
时间段内建设个数 edit3 edit1,edit2都是用户要输入的时间,,button是统计按纽.
对SQL内容进行统计,希望统计到时间段内建设项目的个数,并将结果显示在edit3中,我用的是ADOQuery,用的SQL语句是
select count(*) as count from tabel where 建设时间>='edit1.text' and 建设时间<'edit2.text'
button(统计)用的语句是
adoquery1.close;
adoquery.sql.clear;
adoquery.sql.add('select * from tabel where 建设时间>='edit1.text' and 建设时间<'edit2.text'
');
adoquery1.open;
Edit3.Text:=IntToStr(adoquery1.RecordCount);
end;
可就是没法显示在edit3中,不知道是哪里出现了问题,希望各位路过的高手帮帮忙,谢谢了~
');
adoquery.sql.clear;
adoquery.sql.add('select * from tabel where 建设时间>='''+edit1.text+''' and 建设时间<'''+edit2.text+'''');