📄 mc_chxxtj.pas
字号:
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
Query2.SQL.Add('Where 经受人 <> :B')
else
Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' <> :B');
//-------------------------------------------------
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
Query2.Params[0].AsString:=Edit1.Text;
end
else
begin
Query2.Params[0].AsInteger:=StrToInt(Edit1.Text);
end;
//Query2.Params[0].AsString:=Edit1.Text;
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end;//结束不等号
end;//-结束符号判断--------------------------------------------
end//--结束CheckBox2.CheckEd=True,开始假值------------------------------
else//真假值的分界限------------------------------------------------------------------------
begin//开始CheckBox2.Checked=False--------------------------------------
if ComboBox4.text='Like' then
begin
if Edit1.text='*' then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * From 出货信息历史表');
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end//结束*号判断
else
begin
if (ComboBox3.Items[ComboBox3.ItemIndex]='单据编号') or (ComboBox3.Items[ComboBox3.ItemIndex]='商品编号') or (ComboBox3.Items[ComboBox3.ItemIndex]='数量')
then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * From 出货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
Query1.Params[0].AsString:=Edit1.Text+'%';
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
Query2.Params[0].AsString:=Edit1.Text+'%';
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end;//结束判断字段为整形
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * From 出货信息历史表 where 经受人 Like :A');
Query1.Params[0].AsString:=Edit1.Text+'%';
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
Query2.SQL.Add('Where 经受人 Like :A');
Query2.Params[0].AsString:=Edit1.Text+'%';
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end//结束判断[经受人]字段
else
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('Select * From 出货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
Query1.Params[0].AsString:=Edit1.Text+'%';
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' Like :A');
Query2.Params[0].AsString:=Edit1.Text+'%';
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end;//结束判断字段 [不为经受人]
end;//结束判断为字符型的字段
end;//结束不为Edit1.Text=*的判断
end//技术判断Like
else
begin//开始符号判断
if ComboBox4.Items[ComboBox4.ItemIndex]='=' then
begin
Query1.Close;
Query1.SQL.Clear;
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
Query1.SQL.Add('Select * From 出货信息历史表 where 经受人 = :B')
else
Query1.SQL.Add('Select * From 出货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' = :B');
//--------------------------------------------------
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
Query1.Params[0].AsString:=Edit1.Text;
end
else
begin
Query1.Params[0].AsInteger:=StrToInt(Edit1.Text);
end;
{ if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经受人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
Query1.Params[0].AsString:=Edit1.Text
else
Query1.Parmas[0].AsInteger:=StrToInt(Edit1.Text);}
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
Query2.SQL.Add('Where 经受人 = :B')
else
Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' = :B');
//--------------------------------------------------
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
Query2.Params[0].AsString:=Edit1.Text;
end
else
begin
Query2.Params[0].AsInteger:=StrToInt(Edit1.Text);
end;
//Query2.Params[0].AsString:=Edit1.Text;
Query2.Open;
Label3.Caption:=Query2.Fields[0].AsString+'种';
Label5.Caption:=IntToStr(Query1.RecordCount);
Label7.Caption:=Query2.FieldS[1].AsString;
Label9.Caption:=Query2.Fields[2].AsString;
Query2.Close;
end;//结束等号判断
if ComboBox4.Items[ComboBox4.ItemIndex]='>' then
begin
Query1.Close;
Query1.SQL.Clear;
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
Query1.SQL.Add('Select * From 出货信息历史表 where 经受人 > :B')
else
Query1.SQL.Add('Select * From 出货信息历史表 where '+ComboBox3.Items[ComboBox3.ItemIndex]+' > :B');
//--------------------------------------------------
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
Query1.Params[0].AsString:=Edit1.Text;
end
else
begin
Query1.Params[0].AsInteger:=StrToInt(Edit1.Text);
end;
//Query1.Params[0].AsString:=Edit1.Text;
Query1.Open;
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add('select Count(DisTinCt 商品编号),Sum(数量),Sum(合计金额) from 出货信息历史表');
if ComboBox3.Items[ComboBox3.ItemIndex]='经手人' then
Query2.SQL.Add('Where 经受人 > :B')
else
Query2.SQL.Add('Where '+ComboBox3.Items[ComboBox3.ItemIndex]+' > :B');
//--------------------------------------------------
if (ComboBox3.Items[ComboBox3.ItemIndex]='商品名称') or (ComboBox3.Items[ComboBox3.ItemIndex]='经手人') or (ComboBox3.Items[ComboBox3.ItemIndex]='仓库名称') then
begin
Query2.Params[0].AsString:=Edit1.Text;
end
else
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -