Need Help with summarize an amount over Different rows

  • Thread starter Thread starter M. R.
  • Start date Start date
M

M. R.

Hello,


i have to summarize amounts over different rows which are
grouped by AccountNo (always different) Amount and Hirarchie

For example:
FieldContent
First Row

Hirarchie 1: 1
Hirarchie 2: 0
AccNo.: 20000
Amount: 100$


Second Row

Hirarchie 1: 2
Hirarchie 2: 1
AccNo.: 20300
Amount: 150$


How can i get the sum of the 2 rows, if i link the Field Hirarchie 2 from
the Second Row with Hirarchie 1: from the first Row ? over the Id=1 ?

Your help is highly appreciated !

Thanks in advance
 
hi,
you can't group by AccountNo because they are different.
for this to work you would have to leave out AccountNo and
one of the Hirarchies and group by the other Hirarchie
then sum the amounts.
as a rule, you have to be careful using group by with an
aggragate function like sum or max because group by will
seem to cancel the aggragate function.
in your case you told access to group by accountNo which
it did. and it summed that group. unfortunatly, there was
only 1 ammount to sum in that group.
so by eliminating the AccountNo and other fields that are
different will allow access to group on a field that is
the same and sum all the amounts in that group.
regards
HDR
 
Back
Top