Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Running total using formula to evaluate records Post Reply Post New Topic
Author Message
rusmanicai
Newbie
Newbie
Avatar

Joined: 14 Sep 2011
Location: United States
Online Status: Offline
Posts: 17
Quote rusmanicai Replybullet Topic: Running total using formula to evaluate records
     Posted: 15 Feb 2013 at 10:57am
HI,
I am trying to create a report that calculates time for a 2 week pay period.
I added my elapsed time field in the report, and production start date.
I added two running totals, one for the first week and one for the second week. The running totals are set to summarize on field elapsed time, evaluate when
({sp_MSI_Payroll2weeks;1.startdate}>=date({?@StartDate}) and {sp_MSI_Payroll2weeks;1.startdate}<=dateadd("d",6,date({?@StartDate})))
and reset on change of field employee code.
For the second week, the formula I used is
({sp_MSI_Payroll2weeks;1.startdate}>=dateadd("d",7,date({?@StartDate})) and {sp_MSI_Payroll2weeks;1.startdate}<=date({?@endDate}))

I did this so that I can figure out overtime for each week, then I added formulas that calculate overtime and regular time for week 1 and formulas that calculate these values for week 2. Then I have two more formulas that calculate accumulated overtime and regular time for the two weeks.

Problem is if an employee takes vacation for the entire week, my summary for the week displays nothing, and because I am using the summary in other formulas, which eventually affect my accumulated overtime and regular time, those two formulas also show nothing.
I would like some advice on how to make the running total show 0.00 if there are no transactions between my start date and end date (I forgot to mention that these are the two parameters that are required for user to input. Start of pay period and end of pay period).
If the employee only takes one day of vacation during one week, the summary adds the transactions that occurred beautifully.
I guess what I am trying to find out is what does Crystal
return when there were no records to add up. I tried if if isnull(#sum)=true then 0.00 else #sum -didn't work
if #sum=0 then 0.00 - didn't work.

Your help is appreciated!
Oh, I got to have this report running by Monday:(
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2013 at 11:01am
in all your formulas set the drop down option to 'use default values for null'
IP IP Logged
rusmanicai
Newbie
Newbie
Avatar

Joined: 14 Sep 2011
Location: United States
Online Status: Offline
Posts: 17
Quote rusmanicai Replybullet Posted: 15 Feb 2013 at 11:05am
Thank you so much! THat worked.
IP IP Logged
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