Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I doing a project regarding crystal report.
I need to make some calculation of the total product.
Consignment_Sales_Report.SuppMargin is the amount I want to sum.
But when I click save, it come out a message say that "A number field or currency number field is required here."
Can anyone help me? Where is my wrong?
Or anyone can provide me some useful link for reference?
Below is my code.
Sum ({Consignment_Sales_Report.SuppMargin} )
Posted
Updated 23-Dec-12 15:16pm
v3

To declare a local variable using crystal sintaxe :
Local NumberVar x := Sum ({Consignment_Sales_Report.SuppMargin} );

best regards
 
Share this answer
 
make sure,
Consignment_Sales_Report.SuppMargin
is number field. it should not be string or any other type of column

Other way is...
sum( ToNumber({Consignment_Sales_Report.SuppMargin}) )


Happy Coding!
:)
 
Share this answer
 
Dear all,
I tried code as shown below.
but still get the same error.

local numbervar x :=sum(ToNumber({Consignment_Sales_Report.Quantity}));

sum(ToNumber({Consignment_Sales_Report.Quantity}));

local numbervar x :=sum({Consignment_Sales_Report.Quantity});
 
Share this answer
 
if my variable isn't number,is it will affect this error happened?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900