Click here to Skip to main content
12,509,612 members (43,985 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
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 23-Dec-12 13:54pm
JOE MIS2.6K
Updated 23-Dec-12 15:16pm
v3
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

best regards
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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!
:)
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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});
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

if my variable isn't number,is it will affect this error happened?
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100