sqlvb6activereports

Adding sub total with query in active report


I need to make some sub total in Active reports with vb.6, and the report contain each rowbased on KDKRY such this:

Active report total

How can I sum the 'Hour' according to the KDKRY so I can put it in 'Total Hours' Fields

I Make that report with this query :

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

I already try summary with activereports but it doesnt work,


Solution

  • Provided that your GroupHeader1 section has its DataField set to KDKRY, place a Field control in corresponding GroupFooter1 section and set control's properties like this:

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