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

Error: A number is required here

Status
Not open for further replies.

victora

Programmer
Feb 11, 2002
118
0
0
US
CR 10/SQL Server 2000
I'm using the 3 formula method I came accross from one the thread here.

But i got this error "A number is required here" on my detail formula. MyFormula is {tabname.Svc_Chg} * {tabname.Svc_Unit} and they are both numeric

Thank you

-----------------
Pls see below:

group header:

whileprintingrecords;
numbervar MySum:=0;

Details:

whileprintingrecords;
numbervar MySum:=MySum+{@MyFormula};

group Footer:

whileprintingrecords;
numbervar MySum
 
You didn't show what's in {@MyFormula}, but it's likely that it isn't a numeric...

Try:

whileprintingrecords;
numbervar MySum:=MySum+val({@MyFormula});

If that fails, post what's in any referenced formulas.

-k
 
My guess is that the formula is a currency, so you could use SV's suggestion or try changing the variable to currencyvar instead of numbervar.

-LB
 
Sorry, I missed that you'd posted the formula.

LB's solution sounds right, you can also convert them and then multiply them either in a SQL Expression (fastest), or in CR.

-k
 
First, thank you all for your replies.

The currencyvar works!. I just replaced numbervar with currencyvar on my formulas. The problem is, my group total does not reset after printing. Its behaving like a running total, meaning it includes totals of the previous groups.

Pls help.

Again thank you and happy holidays to ALL!


 
You need a reset formula in the group header if you want this to reset:

WhilePrintingRecords;
If Not InRepeatedGroupHeader then MyVariable:=0

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top