Home Forum Contact

 Access World Forums Sum of fields with "INT" function
 Register FAQ Members List Social Groups Top Posters Search Today's Posts

 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 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
 09-22-2019, 01:25 AM #2 isladogs Part time moderator     Join Date: Jan 2017 Location: Somerset, UK Posts: 10,361 Thanks: 112 Thanked 2,843 Times in 2,593 Posts 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.
 The Following User Says Thank You to isladogs For This Useful Post: scallebe (09-22-2019)
09-22-2019, 02:04 AM   #3
arnelgp

Join Date: May 2009
Location: somewhere out there
Posts: 8,401
Thanks: 68
Thanked 2,703 Times in 2,588 Posts
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"

 The Following User Says Thank You to arnelgp For This Useful Post: scallebe (09-22-2019)
09-22-2019, 01:58 PM   #4
Pat Hartman
Super Moderator

Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,149
Thanks: 15
Thanked 1,572 Times in 1,494 Posts
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

 The Following User Says Thank You to Pat Hartman For This Useful Post: scallebe (09-22-2019)
 09-22-2019, 02:58 PM #5 CJ_London Super Moderator   Join Date: Feb 2013 Location: UK Posts: 11,237 Thanks: 40 Thanked 3,645 Times in 3,515 Posts 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
 The Following User Says Thank You to CJ_London For This Useful Post: scallebe (09-22-2019)
 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 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
09-23-2019, 12:57 AM   #7
CJ_London
Super Moderator

Join Date: Feb 2013
Location: UK
Posts: 11,237
Thanks: 40
Thanked 3,645 Times in 3,515 Posts
Re: Sum of fields with "INT" function

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

 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 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
 09-23-2019, 11:58 AM #9 Pat Hartman Super Moderator   Join Date: Feb 2002 Location: Stratford,Ct USA Posts: 28,149 Thanks: 15 Thanked 1,572 Times in 1,494 Posts 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

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Access World     Access World News     Site Suggestions     Introduce Yourself     The Watercooler Microsoft Access Discussion     General     Tables     Queries     Forms     Reports     Macros     Modules & VBA     Theory and practice of database design     Access Web Microsoft Access Reference     Access FAQs     Code Repository     Sample Databases     Microsoft Access Tutorials     Microsoft Access User Groups Apps and Windows     SQL Server     Crystal Reports     Visual Basic     VB.NET     Word     Excel     Web Design and Development         ASP and ASP.NET         PHP & MySQL     Windows     Other Software     Hardware Questions and Answers Non-Access Issues     Politics & Current Events     Debates     Gaming     Sports, Health & Fitness     Gadgets     Small Business

 Similar Threads Thread Thread Starter Forum Replies Last Post AccessPractice Tables 2 06-24-2016 05:37 AM shdale Queries 8 10-29-2014 05:20 AM vancey Queries 0 03-17-2011 01:43 AM KP_SoCal Modules & VBA 6 12-04-2009 04:35 PM

All times are GMT -8. The time now is 05:37 AM.

 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