# Sum of fields with "INT" function (1 Viewer)

#### scallebe

##### Registered User.
Good morning everybody,

I have in my report some calculated fields and I want to calculate the sum of these fields in my pagefooter.

From the calulated fields I need the integer part of the result.

The formule for I use is e.g. Fieldname : "Fifty" =Int([payOut]/50) and it works fine.

e.g. 2320/50 = 26,4 --> integer part = 26

Now I want to make the sum of these fields in my page footer and it doesn't work… :banghead:

I use the formula : =Sum([Fifty])

When running the report Access asks me a parameter value "Fifty"

Thanks

Greetz

Pascal

##### CID
Try
Code:
``=Sum(Int([payOut]/50))``
Or if you want to round the values after summing, use
Code:
``= Int(Sum([payOut]/50))``
Hope that helps

Last edited:

#### arnelgp

you can also use query as recordsource of your report:
Code:
``````select payout,
[payout]\50 as Fifty,
(select sum([payout]\50) from yourTable) As Expr1
from yourTable group by payout;``````
all you need to do is set the ControlSource of your textbox in page footer to Expr1.

#### Pat Hartman

##### Super Moderator
Staff member
I use the formula : =Sum([Fifty])
You CANNOT reference a control name in a calculation outside of the section where it is defined.
Now I want to make the sum of these fields in my page footer and it doesn't work
Page footers do not maintain break logic the way group headers and footers do. maybe they should but they don't so you can't use this method to sum the contents of a page.

Staff member

#### scallebe

##### Registered User.

#Pat Hartman,

That was something I didn't know, It explanes a lot in my other DB's …

See you all next time.

Greetz

Pascal

#### CJ_London

##### Super Moderator
Staff member
to help others who might find this thread when having a similar problem - it would be helpful for them to know which of the solutions you tried worked for you - or perhaps none of the worked?

#### scallebe

##### Registered User.

The 2 formula's of Isladogs worked fine...

Working with a query was also a good method #arnelgp

And AllanBrown's solutions : Works fine too… #CJ LONDON

Thanks a lot...

Greetz

Pascal

#### Pat Hartman

##### Super Moderator
Staff member
I hate to post "you can't do that" but the others had already provided work arounds. Information is power. Glad it is working for you.