with qry7 do
begin
close;
SQL.Add('update stockpile set 代用计数=代用计数+:a where 部品品番=:b and convert(char(7),结存日期,121)=convert(char(7),dateadd(mm,-1,getdate()),121)');
Parameters.ParamByName('b').Value:=Trim(cxLookupComboBox3.Text);
Parameters.ParamByName('a').Value:=(pyjc-dy);
ExecSQL;
end;
//更新前 代用计数=200,现在:a计算结果=18,在更新后应该是218,但现在结果是18.请指教教了.
解决方案 »
- DELPHI大批量数据按数据库小批量数据排列
- 向Listbox1中动态添加项目的时候,不添加重复项,代码错在哪里了?
- dbgrid无法打开datamodule中adoquery的数据库
- 在wwDBGrid中,处理keydown事件时的问题!
- 有谁知道MSCOMM这个控件在哪里下啊?是不是delphi里面自带的啊?
- 如何改变滚动条的颜色与样式。up有分(分不过再给)
- 如何在一个应用程序里生成另一个可执行文件,并保存到指定的位置?
- 请教DelphiXE7开发的程序在WIN8.1下运行报错的问题
- 强制关闭窗口
- 应用程序运行出错,请高手指点!
- 点“复制”按钮,把listbox的内容复制到剪贴板?
- 一个很简单的问题,希望能帮我解决。
begin
close;
SQL.Clear;
...
end;
with qry7 do
begin
close;
sql.clear;
SQL.Add('update stockpile set 代用计数=代用计数+:a where 部品品番=:b and convert(char(7),结存日期,121)=convert(char(7),dateadd(mm,-1,getdate()),121)');
Parameters.ParamByName('b').Value:=Trim(cxLookupComboBox3.Text);
Parameters.ParamByName('a').Value:=(pyjc-dy);
showmessage(sql.text);
ExecSQL;
end;
if DataSet = nil then Exit;
with (DataSet as TADOQuery) do
begin
SQL.Clear;
SQL.Text := ' UPDATE table_daylog SET [Date] = :p_date, [Style] = :p_style, ' +
' [Area] = :p_area, [Content] = :p_content, [Fee] = :p_fee ' +
' WHERE [Id]=:p_id';
Parameters.ParamByName('p_id').Value := FId;
Parameters.ParamByName('p_date').Value := FDate;
Parameters.ParamByname('p_style').Value := FStyle;
Parameters.ParamByName('p_area').Value := FArea;
Parameters.ParamByName('p_content').Value := Content;
Parameters.ParamByName('p_fee').Value := FFee;
try
ShowMessage(SQL.Text);
ExecSQL;
finally
Close;
end;
end;