where_str:=' prdtno='+''''+ComboBox1.Items[ComboBox1.Itemindex]+''''; where_str:=where_str+' and (orderdate>='+''''+datetostr(datetimepicker1.Date)+''''; where_str:=where_str+' and orderdate<='+''''+datetostr(datetimepicker2.Date)+''''+')'; cmdtxt:=cmd_1; Insert(' where '+where_str,cmdtxt,Pos('group',cmdtxt)-1); try if dm_martpicture.T_avegeprice.Active then dm_martpicture.T_avegeprice.Close; dm_martpicture.T_avegeprice.CommandText:=cmdtxt; finally dm_martpicture.T_avegeprice.Open; end; where_str:='';
where_str:=where_str+' and (orderdate>='+''''+datetostr(datetimepicker1.Date)+'''';
where_str:=where_str+' and orderdate<='+''''+datetostr(datetimepicker2.Date)+''''+')';
cmdtxt:=cmd_1;
Insert(' where '+where_str,cmdtxt,Pos('group',cmdtxt)-1); try
if dm_martpicture.T_avegeprice.Active then dm_martpicture.T_avegeprice.Close;
dm_martpicture.T_avegeprice.CommandText:=cmdtxt;
finally
dm_martpicture.T_avegeprice.Open;
end;
where_str:='';