percentage in report

Ravi Kumar

Registered User.
Local time
Tomorrow, 02:18
Joined
Aug 22, 2019
Messages
162
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?
 

Attachments

  • percentage.jpg
    percentage.jpg
    107.3 KB · Views: 148
I *think* if any of them are Null, then that will happen.
Surround each with the NZ() function and try that.

HTH
 
use the calculation on the Sum textboxes.
 
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)
 
Now I do not know if Null is causing the problem, but you do not have the correct syntax for NZ() to start with.:confused:

Also if you are doing math on the controls, do you not think zero would be a better option rather than space?:(
 
I replaced the empty cells with Zero & now it is working. Thank you for your tip.
 
That is what the NZ() function is meant to do?
 

Users who are viewing this thread

Back
Top Bottom