Group sum not working right
I have a simple report that I am trying to produce. I am trying to display an product code and the number of cases for that product in inventory. And a total for all the items. I have built a formula field (nbr_items) to calculate the number of items :
if {C_MVT_H.MVT_EFF_TRANS_DATE} - {?Start_Date} < 0
and {C_MVT_H.MVT_EFF_TRANS_DATE} <= {?End_Date} then
if {C_MVT_H.MVT_TRANS_TP} = 'CR'
or {C_MVT_H.MVT_TRANS_TP} = 'CO'
or {C_MVT_H.MVT_TRANS_TP} = 'A'
or {C_MVT_H.MVT_TRANS_TP} = 'BF'then
{C_MVT_H.MVT_UNIT}
else
0
else
0
And another to calculate sum (sum_nbr_items) :
sum({@Nbr_Items})
I put the sum_nbr_items in a group header section that breaks on item code. This works when I only have one item, but when I have more that one, it creates a seperate group for the other item which is right, but then sums both items up.
Any help, documentation, anything is helpful. I am new to this crystal reports thing.