Group SubTotal with condition

D

dgrosh

In my report.. I have many different groups. I have a Group Header that
inserts a page break in between the various groups... Each line item in the
table is identified by Asset or Liability. I need to total all the Assets
and then the Liabilities in the Group Header. I think I need an IF
Statement. This is the statement I came up with but it's not quite right.

=Sum(IIf([asset/liability]=[asset],([prior qtr],0)))
=Sum(IIf([asset/liability]=[liability],([prior qtr],0)))

Asset/Liability is a header in my table. What I'm trying to say.... If
Asset/Liabilities equals asset, give me the sum of the amounts in the prior
qtr fields.
 
D

Duane Hookom

Your asset and liability values are strings, not fields.
Try:
=Sum(Abs([asset/liability]="asset") *[prior qtr])
=Sum(Abs([asset/liability]="liability") *[prior qtr])
 
D

dgrosh

Thank you Very Much.... Exactly what I needed. Appreciate the help!!

Duane Hookom said:
Your asset and liability values are strings, not fields.
Try:
=Sum(Abs([asset/liability]="asset") *[prior qtr])
=Sum(Abs([asset/liability]="liability") *[prior qtr])

--
Duane Hookom
Microsoft Access MVP


dgrosh said:
In my report.. I have many different groups. I have a Group Header that
inserts a page break in between the various groups... Each line item in the
table is identified by Asset or Liability. I need to total all the Assets
and then the Liabilities in the Group Header. I think I need an IF
Statement. This is the statement I came up with but it's not quite right.

=Sum(IIf([asset/liability]=[asset],([prior qtr],0)))
=Sum(IIf([asset/liability]=[liability],([prior qtr],0)))

Asset/Liability is a header in my table. What I'm trying to say.... If
Asset/Liabilities equals asset, give me the sum of the amounts in the prior
qtr fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top