Month of DecodeDate = Combobox1.ItemIndex or ......
解决方案 »
- 200分 求Skin Builder 4.42
- imagelist控件只能加载bmp,ico图片?
- 难题!想知道IE何时被打开了,并且取得它打开的URL。
- QuickReport中怎样将不足一页的空白纸张用空行补充?
- 请问在FastReport中如何实现变量打印
- 在多客户端使用的情况下,如何保证insert到表的值是按顺序增加?
- 关于copy的用法
- 大家帮忙看看为什么错,要怎么去写?(简单问题!)
- 屏蔽鼠标右键后,怎么恢复???
- 有关InstallShield for delphi
- 为什么出现list index out of brounts(-1)?
- 哪位有Delphi5 Trail edition的安装password?
if month = combobox1.itemindex-1 then ...
else ...
procedure Tf_total_month.SpeedButton1Click(Sender: TObject);
var
Date:Tdatetime;
year,month,day:word;
str:string;
begin
adoquery1.close;
adoquery1.sql.clear;
adoquery1.SQL.add('select * from t_szb');
adoquery1.Open;
date:=adoquery1.fieldbyname('dtime').asdatetime;
decodedate(date,year,month,day);
if month=combobox1.itemindex-1 then
begin
adoquery2.Close;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('select * from t_szb');
adoquery2.SQL.Add('where 后面怎样写? ); //??????????????//
adoquery2.Open;
if adoquery2.RecordCount=0 then
showmessage('没有数据!');
end;end;
( trim(cboYear1.text)+copy('00',1,2-length(trim(cboMonth1.text)))+trim(cboMonth1.text)+copy('00',1,2-length(trim(cboDay1.text)))+trim(cboDay1.text) )>( trim(cboYear2.text)+copy('00',1,2-length(trim(cboMonth2.text)))+trim(cboMonth2.text)+copy('00',1,2-length(trim(cboDay2.text)))+trim(cboDay2.text) )
procedure Tf_total_month.SpeedButton1Click(Sender: TObject);
var
Date:Tdatetime;
year,month,day:word;
str:string; MinDate, MaxDate: TDate;
S_Date,E_Date : string;
TempSQL : string;
begin
adoquery1.close;
adoquery1.sql.clear;
adoquery1.SQL.add('select * from t_szb');
adoquery1.Open;
date:=adoquery1.fieldbyname('dtime').asdatetime;
decodedate(date,year,month,day); if month=combobox1.itemindex-1 then
begin
adoquery2.Close;
adoquery2.SQL.Clear;
if Month=12 then
begin
MinDate := EncodeDate(year, month, 1);
MaxDate := EncodeDate(year+1, 1, 1);
end else
begin
MinDate := EncodeDate(year, month, 1); //求得当前月份第一天
MaxDate := EncodeDate(year, month+1, 1); //求得当前月份下一月的第一天
end;
S_Date := FormatDateTime('MM''/''dd''/''yyyy', MinDate);
E_Date := FormatDateTime('MM''/''dd''/''yyyy', MaxDate);
TempSQL := Format('SELECT * FROM t_szb WHERE (Date>="%s") AND (Date<="%s")',[S_Date,E_Date]); adoquery2.SQL.Clear;
adoquery2.SQL.Add(TempSQL);
adoquery2.RequestLive := True;
adoquery2.Open; if adoquery2.RecordCount=0 then
showmessage('没有数据!');
end;
end;