另外,你可以用 SQL 在查询时就进行处理,如 select bh,name, point from table union select 'zzz','合计',sum(point) from table 这样你可以不用更改什么程序
可以用存储过程做: 1.create table #temp ( no varchar(20) null, --以便能放下‘合计’两个字 name varchar(20) null Qty float null ) 2. insert into #temp(no,) select no,name,qty from 原始表 3.insert into #temp(no,name,qty) select '合计', ' ',sum(qty) from 原始表 4.select * from #temp order by no 将DATASOURCE的DATASET设为该存储过程
select bh,name, point from table
union
select 'zzz','合计',sum(point) from table
这样你可以不用更改什么程序
1.create table #temp
( no varchar(20) null, --以便能放下‘合计’两个字
name varchar(20) null
Qty float null
)
2. insert into #temp(no,)
select no,name,qty
from 原始表
3.insert into #temp(no,name,qty)
select '合计', ' ',sum(qty)
from 原始表 4.select * from #temp
order by no
将DATASOURCE的DATASET设为该存储过程