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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of 2 fields 1

Status
Not open for further replies.

Pyskow

Technical User
Oct 18, 2006
10
0
0
DK
I need to make a som of 2 summarized fields.

One is a Sum of XXXXXX
The other is a Count of zzzzz (I cant sum this one up, only counting is possible)

These two gives a number each in the report. And i would like to sum up these 2 numbers.


I have tried: Sum ({XXXXXX},{zzzzz}) but i get a message: There must be a group that matches this field Proberly because the zzzzz field is text and not numbers.

Any suggestions ?


Bo Pyskow
Crystal Reports Newbie
 
It sounds like you don't have a group for that particular formula. When you do Sum ({XXXXXX},{zzzzz}) you are asking the database field to be summarized per a group. To fix this just insert a group on the {zzzzz}.

Thanks so much!
satinsilhouette
 
Create a formula:

sum({table.xxxxxx})+count({table.zzzzz})

This assumes you are summing at the report level. If you want sums at a group level, then you need to add the group condition to each summary (which is what the second argument is for):

sum({table.xxxxxx},{table.groupfield})+count({table.zzzzz},{table.groupfield})

-LB
 
Thanks both. Ibass hit the nail right on....thanks :)

Bo Pyskow
Crystal Reports Newbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top