DBGrid1.Columns[0] & SQL (10分)

W

why_119

Unregistered / Unconfirmed
GUEST, unregistred user!
我的sql是这样写的.
SQL.Add('select 销售日期,销售专员,数量,产品名称,销售价格 from d_pen where 销售专员=:s_r');
Parameters.ParamByName('s_r').Value:=listbox2.Items.Strings;
的到了一张表.在表里我想计算‘数量’这一列如何作??????

这样作行吗?
DBGrid1.Columns[0]。。。。。。。
 

应该可以的,你可以试一下嘛!
不过通这样方便:
with adoquery do
begin
while not eof do
begin
...
value := value + table.fieldbyName('fieldname').asInteger;// 后面是你所要的类型
next;
end;
end;
 
上面的方法我试了...可以...它加的是全部...
我这还有条件呢?
where 销售专员=:s_r'
 

Similar threads

S
回复
0
查看
788
SUNSTONE的Delphi笔记
S
S
回复
0
查看
723
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
顶部