Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Calculating the SUM of formula field Post Reply Post New Topic
<< Prev Page  of 3 Next >>
Author Message
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 09 Oct 2008 at 3:17am
X +{@Early_Time1} it gives me error "Numeric Overflow" on this section
IP IP Logged
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 09 Oct 2008 at 3:23am
Below are my formulas:
 
Early_time1 formula:
if ( {@MAXEXITTIME} <= {@TimeExit1}) then
 ({@MAXEXITTIME}- {@TimeExit1}) / 60
else
 0 ;
 
 
Late_time1 formula:
if  ({@MINENTRYTIME} > {@TimeEntry1}) then
({@MINENTRYTIME}- {@TimeEntry1}) / 60
else  0;
 
MAXEXITTIME
DateTimeToTime ({#MAXEXIT})
 
MINENTRYTIME
DateTimeToTime ({#MinEntry})
 
Time_Entry1 formula:
timevalue (08,00,00)
 
 
Time_Exit1 formula:
timevalue (15,00,00)
 
and the rest formulas for totals I took do it like you did exactly and when I run the report it gives me the previous error
 
IP IP Logged
kvwielink
Newbie
Newbie


Joined: 09 Oct 2008
Location: Thailand
Online Status: Offline
Posts: 8
Quote kvwielink Replybullet Posted: 09 Oct 2008 at 3:40am
Hmm, you can try X + time({@early_time1}). Otherwise I'm also not sure.
Don't really have a lot of experience with time functions, but the formula's I gave you worked well for me so far for numeric values and string values.

IP IP Logged
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 09 Oct 2008 at 3:47am
What if I want calculate the total for each employee alone?
 
Each page will display the attendance for certain employee and at the end of this page, total of the min. he's late or went early.
In my report it shows the same but the total till now I  can't do it correctly
 
IP IP Logged
kvwielink
Newbie
Newbie


Joined: 09 Oct 2008
Location: Thailand
Online Status: Offline
Posts: 8
Quote kvwielink Replybullet Posted: 09 Oct 2008 at 3:58am
Sent you a pm with my email address. Please send me a screenshot of the design view.
IP IP Logged
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 09 Oct 2008 at 4:13am
I've already sent you a screen shot to your e-mail add. please check it
IP IP Logged
kvwielink
Newbie
Newbie


Joined: 09 Oct 2008
Location: Thailand
Online Status: Offline
Posts: 8
Quote kvwielink Replybullet Posted: 09 Oct 2008 at 4:15am
Noticed that you have a lot of headers and footers. This might complicate matters. Can you show me the design tab as well, instead of the results? Or better yet, send me the report file.
I'm off home for the day, but should have some time to look at it tomorrow.
IP IP Logged
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 09 Oct 2008 at 4:37am
Ok, I'll send it to you now, thank you so much for your help
Waiting for your remarks
IP IP Logged
wafaa
Newbie
Newbie


Joined: 21 Sep 2008
Location: Kuwait
Online Status: Offline
Posts: 18
Quote wafaa Replybullet Posted: 12 Oct 2008 at 1:09am
Thank you for your effort, I tried the report you modified and the strange thing is that one record is calculating the total correctly and the other one is not and so on, please check the attached file, in your e-mail, is it something wrong with the equation or the place of it?
IP IP Logged
joeyg13
Newbie
Newbie
Avatar

Joined: 21 Dec 2010
Online Status: Offline
Posts: 15
Quote joeyg13 Replybullet Posted: 25 Mar 2011 at 7:42am
Wow,
"Crystal Reports builds reports in two passes. The first pass does basic reading of data and simple formulas. The second pass performs complex formulas and summing data. When you get this error it means that the formula you are using has to be calculated in the second pass and since this is the same pass where the summing is done, it gets confused. It can only do sums on formulas that had their values calculated in the first pass.
To fix this problem, create a running total formula which uses a global numbervar to add the numbers as they are printed."

Thanks Brian.  I just read more in your book.  Now it makes sense how/why I could not sum/count on certain fields that are the result of other sum/counts or shared variables from subreports.
I see what you explain above.  However, for my task at hand I am working with 20+ data fields from secondary calculations.  (Accessing tables with one-to-many relationships; therefore a need for complex rules to only extract certain data.) Thus, this current project requirement is BEYOND the capability of Crystal. 
IP IP Logged
<< Prev Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.