Subtotal Formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a subreport "SR" within a report "R". The subreport is pulling the
data from a table "T". The data in the table is separated by two groups:
Group A and Group B.

The subreport SR would show a list of transactions for Groups A and B. At
the bottom of the subreport SR (Report Footer), I want to show the net of sum
of Groups A & B.

The formula should be "sum of Group B" - "sum of Group A".

I tried Dsum, and it didn't work.

Please help. Thanks.
 
I also tried this formula:
=(IIf([Group]='A',SUM([Amount]),0))-(IIf([Group]='B',SUM([Amount]),0)).

When I use that fomula, it gives me a total of Groups A and B.

Thanks.
 
You told us almost everything needed except the sum of what and the name of
the group field??? Assuming you have a field [Quantity] and wanted the sum
this field for both [Gender] = "F" and [Gender] = "M"...

=Sum( Abs([Gender] = "F") * [Quantity])
and
=Sum( Abs([Gender] = "M") * [Quantity])
 
Thanks Duane. Have a nice weekend.

Duane Hookom said:
You told us almost everything needed except the sum of what and the name of
the group field??? Assuming you have a field [Quantity] and wanted the sum
this field for both [Gender] = "F" and [Gender] = "M"...

=Sum( Abs([Gender] = "F") * [Quantity])
and
=Sum( Abs([Gender] = "M") * [Quantity])

--
Duane Hookom
MS Access MVP
--

AccessHelp said:
Hello,

I have a subreport "SR" within a report "R". The subreport is pulling the
data from a table "T". The data in the table is separated by two groups:
Group A and Group B.

The subreport SR would show a list of transactions for Groups A and B. At
the bottom of the subreport SR (Report Footer), I want to show the net of
sum
of Groups A & B.

The formula should be "sum of Group B" - "sum of Group A".

I tried Dsum, and it didn't work.

Please help. Thanks.
 
Back
Top