Click here to Skip to main content
15,889,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for eg:
Percentage=(Present)/(totaldays-weekoff)
consider this is for attendance percentage,it displays ZERO

Can anyone help me to find the solution i.e., is there any significance in SQL or normally it can be evaluated Mathematically.
Posted
Updated 5-Dec-13 0:44am
v2

1 solution

Don't use INTEGER datatypes.
If Present is integer, then anything divided by it is integer, so numbers less than 1 become zero.

Try this to prove it:
SQL
Percentage=(Present * 100)/(totaldays-weekoff)
 
Share this answer
 
Comments
CPallini 5-Dec-13 6:55am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900