Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Report Design
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Report Design
Topic: dividing to fields to show percentage
Author
Message
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Topic: dividing to fields to show percentage
Posted: 27 Mar 2013 at 4:01am
working on an overtime report and trying to get this to work
shared numbervar RegTotal := If({field}) = "Reg" Then Sum({field});
shared numbervar OtTotal := If ((Instr({field},"Over") >= 0)) Then Sum({field});
RegTotal / OtTotal * 100
seems pretty simple but it's returning 0 for some reason. if i remove the Sum portion of the above code it then returns 100.
i'm not really sure what i am missing or if i am missing something here. any help or guidance is definitely appreciated.
thank you!
IP Logged
Sastry
Moderator
Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Posted: 27 Mar 2013 at 10:15pm
Hi
Check this statement :
If ((Instr({field},"Over") >= 0)) Then Sum({field});
If it finds "Over" or not it will sum(field) because you are checking with '>=' Is it a requirement ? other wise use only '>'
Also create two different formulas for each condition and place in your report to check what it is returning.
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.