# Sum a non-field column in crystal reports v10

How would I sum the non-field columns in my crystal reports. Error message is
"A field is required here."
By the way the column figures on my crystal reports which I wanted to sum up are results of formulas using visual basic syntax.
Thanks a lot.

``````Example:
How can I obtain sum of the following basic syntax code:

shared cAmountSched as currency
shared cAmountSchedBranch as  currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}
``````
###### 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.

Commented:
shared cAmountSched as currency
shared cAmountSchedBranch as  currency
Dim Tot as currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
Tot= Tot+cAmountSched - {ZZ_LAPO_Arrear.arrearamt}
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

Then create a new formula field to display Tot
0
Author Commented:
peter57r:

Thanks. But the figures that would display on my new formula field named Tot is
the last entry or line of the column being summed. Hope you can further analyze
the problem.
0
Commented:
Sorry...the variable declaration should be:
Global Tot as currency
0
Author Commented:
peter57r
Kindly review my formulas peter57r, where did I go wrong? And
if you can give me your suggested 'scripting' then I will appreciate
it very much.
1. I created a column named IntBalArrears which worked so fine by:

shared cAmountSched as currency
shared cAmountSchedBranch as  currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

2.Then I made a column total or sum by using your suggestions which
unfortunately did not work:

shared cAmountSched as currency
shared cAmountSchedBranch as  currency
Global Tot as currency
cAmountSchedBranch = cAmountSchedBranch + cAmountSched
Tot= Tot+cAmountSched - {ZZ_LAPO_Arrear.arrearamt}
formula = cAmountSched - {ZZ_LAPO_Arrear.arrearamt}

Thank you and more power.
0
Author Commented:
peter57r:
For further info,  I placed formula 1 above within Group Footer #2 section of the report,
and formula 2 within Group Footer #1.
I do not know if it has bearing to the results or outcome of the computations.
Thanks.
0
Commented:
The change I made was to MODIFY your original formula field,  NOT to create a new one. You don't need both formula fields

To display Tot all you do is create a formula field which is...

Whileprintingrecords
Global Tot as currency
formula= Tot
0

Experts Exchange Solution brought to you by