I have formulas that are not working to accum grand totals

I have this Formula for Yearly Totals

Shared NumberVar yearlyWages;
Shared NumberVar GrandWages;
GrandWages := GrandWages + yearlyWages;
yearlyWages;
It is placed in Group2 footer(there is nothing in Group1 footer)
In the report footer I have this formula for Grand Total
Global NumberVar GrandWages;
GrandWages

Yearly wages works fine.. it is being reset to 0 in Group header 2.
The GrandWages in the report footer is 0.  It does not have the accumulated value.
What am I doing wrong?
qbjgqbjgConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
The variable declarations must match.

Do you have a subreport?
If not then just use GLOBAL variables

for now change the formula in the report footer to
Shared NumberVar GrandWages;
 GrandWages 

Open in new window


mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
qbjgqbjgConsultantAuthor Commented:
Thanks, I will try that.
0
qbjgqbjgConsultantAuthor Commented:
That worked for mostmof the totals in my grand total line except for 1 that is a little more complicated. I have this formula in Group2 Footer
Shared NumberVar yearlyWages;
Shared NumberVar MatchAllowed;
Shared NumberVar GrandAllowed;
Shared NumberVar Yearly401K;
Shared NumberVar Yearly401KM;
If (yearlyWages * .10) <= Yearly401K then
MatchAllowed := (yearlyWages * .10) * .10
else
MatchAllowed := Yearly401K * .10;
GrandAllowed := MatchAllowed;
MatchAllowed

and this one in Report Footer

Shared NumberVar GrandAllowed;

GrandAllowed

It is only getting the previous total.
MatchAllowed is not being cleared anywhere. It is working fine, just not accumulating in GrandAllowed.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

qbjgqbjgConsultantAuthor Commented:
Never mind, I think I see it.
0
qbjgqbjgConsultantAuthor Commented:
How do I submit it. I selected your answer as best answer.
0
mlmccCommented:
Just click the BEST SOLUTION box in the comment
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.