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

scallebe

Registered User.
Local time
Today, 08:22
Joined
Mar 23, 2018
Messages
51
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"

Can someone help me please… :(

Thanks

Greetz

Pascal :cool:
 

isladogs

CID Moderator
Staff member
Local time
Today, 07:22
Joined
Jan 14, 2017
Messages
13,406
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

error reading drive A:
Local time
Today, 14:22
Joined
May 7, 2009
Messages
9,600
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
Local time
Today, 02:22
Joined
Feb 19, 2002
Messages
29,006
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.
 

scallebe

Registered User.
Local time
Today, 08:22
Joined
Mar 23, 2018
Messages
51
Thank you all for reply.

I tested all your solutions…:):)

#Pat Hartman,

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

See you all next time.

Greetz

Pascal :cool:
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:22
Joined
Feb 19, 2013
Messages
12,128
I tested all your solutions…
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.
Local time
Today, 08:22
Joined
Mar 23, 2018
Messages
51
ok, sorry about that...:(

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 :cool:
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:22
Joined
Feb 19, 2002
Messages
29,006
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom