发新话题
打印

[控件] 如何把dategrid中的一列值求和并把求得的和显示到一个文本框中

如何把dategrid中的一列值求和并把求得的和显示到一个文本框中

Adodc1.RecordSource = "select a.cpcode [产品编号],b.mno [供应商编号],a.stockno [采购单号],a.stockbatchno [项次],a.intenddate [应到日期]," _
+ "a.stockflag [进货状态],isnull(sum(a.sumtempcount),0) [累计暂收量],isnull(sum(a.badcount),0) [不合格数],isnull(sum(a.factcount),0) [合格品数], " _
+ "sum(a.productnum) [采购数],isnull(sum(a.sumtempcount)/sum(a.productnum),0) [订单送货率]," _
+ "isnull(sum(a.factcount)/sum(a.sumtempcount),0) [入库率],isnull(sum(a.factcount)/sum(a.productnum),0) [订单完成率] " _
+ "from cg_stock_list a,cg_nationstock b  Where a.stockno = b.stockno  and (a.stockflag<>'4' or (a.stockflag='4' and a.sumtempcount>0)) " _
+ "and (a.intenddate between '" + Str(DTPicker1.Value) + "' AND '" + Str(DTPicker2.Value) + "') and b.mno like'%'+ '" + Text1.Text + "'+'%'  " _
+ "group by a.cpcode,b.mno,a.stockno,a.stockbatchno,a.stockbatchno,a.intenddate,a.stockflag"
set datagrid1.datesouce=adodc1
如何把datagrid1中“订单完成率”这一列求和出来。

[ 本帖最后由 wine_wu 于 2007-8-10 08:55 编辑 ]
why

TOP

请各位大虾帮忙
why

TOP

发新话题