在活动报告中添加带有查询的子总计

时间:2017-10-30 08:16:38

标签: sql vb6 activereports

我需要在Active reports中使用vb.6制作一些小计,并且报告包含基于KDKRY的每个行,例如:

Active report total

如何根据KDKRY对“小时”求和,以便将其放入“总小时数”字段

我使用此查询制作该报告:

select A.KDKRY, A.NMKRY, E.NMTOW,B.NMSTOW, SUM(C.HSTOW)JAM, 
COUNT(C.TGLWORK)MDAY, SUM(D.THSTOW)TOT
from TBL_KRY A, TBL_STOW B, TBL_DTSHEET C, TBL_HDTSEET D, TBL_TOW E
Where E.KDTOW = C.KDTOW and A.KDKRY = D.KDKRY And A.CJABATAN = 'OFFICER TEKNIS'
And C.KDHDTS = D.KDHDTS And B.KDSTOW = C.KDSTOW and C.TGLWORK between
'01.10.2017' and '31.10.2017'
group by A.KDKRY, A.NMKRY, E.NMTOW, B.NMSTOW

我已经尝试使用activereports汇总但它不起作用,

1 个答案:

答案 0 :(得分:0)

如果您的GroupHeader1部分的DataField设置为KDKRY,请将Field控件放在相应的GroupFooter1部分,并设置控件的属性,如下所示:

DataField:       JAM
SummaryFunction: 0 - ddSFSum
SummaryGroup:    GroupHeader1
SummaryType:     3 - ddSMSubTotal