Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-22-2019, 01:12 AM   #1
scallebe
Newly Registered User
 
Join Date: Mar 2018
Posts: 51
Thanks: 29
Thanked 1 Time in 1 Post
scallebe is on a distinguished road
Sum of fields with "INT" function

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…

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

scallebe is offline   Reply With Quote
Old 09-22-2019, 01:25 AM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,327
Thanks: 112
Thanked 2,835 Times in 2,585 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Sum of fields with "INT" function

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
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by isladogs; 09-22-2019 at 01:38 AM.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
scallebe (09-22-2019)
Old 09-22-2019, 02:04 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,342
Thanks: 67
Thanked 2,678 Times in 2,564 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Sum of fields with "INT" function

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.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
scallebe (09-22-2019)
Old 09-22-2019, 01:58 PM   #4
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,109
Thanks: 15
Thanked 1,564 Times in 1,487 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Sum of fields with "INT" function

Quote:
I use the formula : =Sum([Fifty])
You CANNOT reference a control name in a calculation outside of the section where it is defined.
Quote:
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.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following User Says Thank You to Pat Hartman For This Useful Post:
scallebe (09-22-2019)
Old 09-22-2019, 02:58 PM   #5
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,224
Thanks: 40
Thanked 3,641 Times in 3,512 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Sum of fields with "INT" function

have you tried allen browne's technique for summing in page footers?

http://allenbrowne.com/ser-11.html
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
scallebe (09-22-2019)
Old 09-22-2019, 11:17 PM   #6
scallebe
Newly Registered User
 
Join Date: Mar 2018
Posts: 51
Thanks: 29
Thanked 1 Time in 1 Post
scallebe is on a distinguished road
Re: Sum of fields with "INT" function

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 …

See you all next time.

Greetz

Pascal
scallebe is offline   Reply With Quote
Old 09-23-2019, 12:57 AM   #7
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,224
Thanks: 40
Thanked 3,641 Times in 3,512 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Sum of fields with "INT" function

Quote:
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?

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 09-23-2019, 01:33 AM   #8
scallebe
Newly Registered User
 
Join Date: Mar 2018
Posts: 51
Thanks: 29
Thanked 1 Time in 1 Post
scallebe is on a distinguished road
Re: Sum of fields with "INT" function

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
scallebe is offline   Reply With Quote
Old 09-23-2019, 11:58 AM   #9
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,109
Thanks: 15
Thanked 1,564 Times in 1,487 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Sum of fields with "INT" function

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.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input " Like A* " in Validation Rule Property but it shows " ALike "A*" " AccessPractice Tables 2 06-24-2016 05:37 AM
If "TableA.FieldA" exists in "TableB.FieldB" then return "1" else "2" shdale Queries 8 10-29-2014 05:20 AM
Qry To Exclude Record If All Fields On Page Is Blank Except Field "xx", "yy" And "zzz vancey Queries 0 03-17-2011 01:43 AM
"In Between" function that behaves similarly to a "Mid String" function KP_SoCal Modules & VBA 6 12-04-2009 04:35 PM




All times are GMT -8. The time now is 12:17 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World