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!

Error can't sum a field 1

Status
Not open for further replies.

travelerII

Technical User
Jun 4, 2009
66
0
0
US
I have Crystal 10 and I have written a report to give me the value of materials only that have been issued to certain accounts by department.
Some of the items are raw materials and I just get the cost of the item. Some of the items are finished goods so I only need the material costs, not labor or overhead. Some of the transactions are WIP transactions for materials used in production.

I use the following formula for amount.
{GACCENTRYD.SNS_0}*{GACCENTRYD.AMTCUR_0}

And the following formula for Sum of Amount
Sum ({@Amount} ,{GACCENTRYA.NUM_0} )

I wrote a sub report to get the total material costs for either a raw material or finshed good.
if {STOJOU.CCE2_0} = "STK" then ({STOJOU.AMTVAL_0}*-1) else
({ITMCOST.MATTOT_0}*-1)*{STOJOU.QTYSTU_0}

Then I wrote the following formula to give me the value of materials only in each transaction.
if {GACCENTRYA.NUM_0} startswith "WIP" then {@Sum of Amount} else {@Shared Var SumMatCost}
I have grouped the report by {GACCENTRYA.NUM_0} and place the material value formula in the group.
All of this works great I have checked the results and the information is accurate and exactly what I need.

The problem is that I am unable to sum the material value. When I try to sum it I get a error message that I cannot sum this field. Same thing if I try to use a running total. I even tried a cross tab in the footer but it is only returning the information for GACCENTRYA.NUM_0 that start with "WIP" not the information from the sub report even though it comes across fine in the main report.
There must be a way to get a total of the material value.
Any help is greatly appreciated.
 
Did you find the solution to your problem? I am getting the same error message with the following:

if Sum ({MSG_DST_ENTERPRISE__PROTOCO_VW.Total_msg}, {MSG_DST_ENTERPRISE__PROTOCO_VW.DATE}, "daily") <> 0
then
Sum ({@SMTP}, {MSG_DST_ENTERPRISE__PROTOCO_VW.DATE}, "daily") *100/
Sum ({MSG_DST_ENTERPRISE__PROTOCO_VW.Total_msg}, {MSG_DST_ENTERPRISE__PROTOCO_VW.DATE}, "daily")
else
0
 
travelerII,

If you are looking for a report level total, then add a formula like this to the section where you are placing your material value formula:

whileprintingrecords;
numbervar sumx := sumx + {@matval};

Then in the report footer, use the following to display the results:
whileprintingrecords;
numbervar sumx;

If you want the results instead at a higher order group level, then add a reset formula to the group header for that group:

whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top