Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-28-2019, 02:10 AM   #1
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 69
Thanks: 82
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
percentage in report

dear all,

I have entered below expression to show percentage in my report , but unfortunately it is not displaying.
Code:
=[Sum Of Leave(Hrs)]/([Sum Of Leave(Hrs)]+[Sum Of LOP(Hrs)]+[Sum Of Absent(Hrs)]+[Sum Of OT(Hrs)])
can anyone help where i am wrong?
Attached Images
File Type: jpg percentage.jpg (107.3 KB, 12 views)

Ravi Kumar is offline   Reply With Quote
Old 09-28-2019, 02:31 AM   #2
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,083
Thanks: 421
Thanked 751 Times in 729 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: percentage in report

I *think* if any of them are Null, then that will happen.
Surround each with the NZ() function and try that.

HTH
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

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.
Gasman is offline   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
Ravi Kumar (09-29-2019)
Old 09-28-2019, 07:05 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,402
Thanks: 68
Thanked 2,703 Times in 2,588 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: percentage in report

use the calculation on the Sum textboxes.

__________________
"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:
Ravi Kumar (09-28-2019)
Old 09-28-2019, 07:13 PM   #4
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 69
Thanks: 82
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: percentage in report

Quote:
Originally Posted by arnelgp View Post
use the calculation on the Sum textboxes.
Code:
=Nz("",[Sum Of Leave(Hrs)])/Nz("",([Sum Of Leave(Hrs)]+[Sum Of LOP(Hrs)]+[Sum Of Absent(Hrs)]+[Sum Of OT(Hrs)]))
Like this??(not working)
Ravi Kumar is offline   Reply With Quote
Old 09-29-2019, 12:02 AM   #5
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,083
Thanks: 421
Thanked 751 Times in 729 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: percentage in report

Now I do not know if Null is causing the problem, but you do not have the correct syntax for NZ() to start with.

Also if you are doing math on the controls, do you not think zero would be a better option rather than space?
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

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.
Gasman is offline   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
Ravi Kumar (09-29-2019)
Old 09-29-2019, 07:09 PM   #6
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 69
Thanks: 82
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: percentage in report

I replaced the empty cells with Zero & now it is working. Thank you for your tip.
Ravi Kumar is offline   Reply With Quote
Old 09-29-2019, 11:40 PM   #7
Gasman
Enthusiastic Amateur
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,083
Thanks: 421
Thanked 751 Times in 729 Posts
Gasman has a spectacular aura about Gasman has a spectacular aura about Gasman has a spectacular aura about
Re: percentage in report

That is what the NZ() function is meant to do?


__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

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.
Gasman is offline   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
Ravi Kumar (09-30-2019)
Reply

Tags
expression builder , report calculations

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help please - calculate percentage of a sum in a report Manaz Reports 0 12-02-2008 01:31 AM
Percentage in a Report CoachPhil Reports 3 08-26-2008 04:39 PM
Percentage in Report returns nothing.... CEH Reports 14 12-30-2005 09:16 AM
Percentage in report nicola1 General 1 08-09-2005 02:15 AM
how to calculate percentage in report abieyuwae Reports 1 11-03-1999 10:43 AM




All times are GMT -8. The time now is 06:21 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


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