Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum on group 1

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
In crystal 9.0, I have a report that has the following:

Group 1: @approved
if isnull({Command.FLDREIMBURSEMENTAPPROVEDDATE})
and isnull({Command.FLDREIMBURSEMENTDENIEDDATE}) then
"Not Yet Approved"
else if not isnull({Command.FLDREIMBURSEMENTDENIEDDATE}) then
"Denied"
else
"Approved"

Group 2: Project Number
Details:
number name cipnum costestimate



with output that looks like:

1234 1234name w123.01 33,000
1234 1234name e123.00 33,000
1234 1234name w33.95 33,000
9999 999name w111.11 157,000,200
i supress the duplicates so only the different cipnums and cost estimates show.

What I need to do now is to sum the cost estimate by project number. What happens is that it is adding all of the cost estimates and I only want the first one.

What I need to come up with is:
Group 1 header: Approved 157033200
1234 1234name w123.01 33,000
e123.00
w33.95
9999 999name w111.11 157,000,200


instead what I get is:
Group 1 header: Approved 157099200.00
1234 1234name w123.01 33,000
e123.00
w33.95
9999 999name w111.11 157,000,200


How do I set this up? I tried running total and it gives me the same answer.
thanks
Lhuffst
 
You need to set up the running total to sum costestimate, evaluate on change of group: Project No. Reset on change of Group #1. But you must only display this in the Group Footer #1. It will not be correct in the Group Header.

-LB
 
LB That worked perfect. Is there a way to get the into into a header?
Thanks
Lhuffst
 
You could try adding a subreport in the group header that selects distinct records and does not use the CIP number. This might return the distinct records you need to return a simple sum.

Or you could save the current report as a subreport in the GH#1 header and link it on the Group #1 field, with all sections suppressed except the subreport footer which would display the running total.

-LB
 
ok thanks. I'm sure one of them will work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top