Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Percentage Miscalculation
Author
Message
Dbeethekidd
Newbie
Joined: 12 Oct 2012
Location: United Kingdom
Online Status: Offline
Posts: 7
Topic: Percentage Miscalculation
Posted: 21 Nov 2012 at 10:40pm
Hi All
I'm having an issue with a calculation which seems to think that is you divide 0 by 100 you should get 100% which is most certainly not the case
My formula reads
if Sum ({@Catering Count}) = 0 then 0 else (Sum ({@Catering Pass})) % (Sum ({@Catering Count}))
The Catering Count = 1 and the Catering Pass = 0
Now I know either way the answer should be 0% or some kind of error saying you can't divide 1 by 0 but instead I get 100%
Any ideas/help/explanation would be greatly appreciated
Thanks again
DB
IP Logged
Sastry
Moderator
Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Posted: 21 Nov 2012 at 11:59pm
Hi
As we all know 0 divide by any value is zero only there will not be any number.
Try the following :
if Sum ({@Catering Count}) <> 0 then
( Sum ({@Catering Pass}) / Sum ({@Catering Count}))*100
else
0
Thanks,
Sastry
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.