I have a report that is set up as follows:

irb01 8:00AM 8:05AM 5:00
irbo1 8:06AM 8:07AM 1:00

6:00

eos01 8:08AM 8:15AM 7:00

This is the way that I need it towork: 7:00
This is the way that it works: 13:00

I have a group band that uses a Request_ID and I want to be able to reset each time the Request_ID changes. That way, I'm not getting a runing toal of the entire dataset, which is not what I want. I need to be able to get the time(s) for each job set and then a grand total at the end.

I have a formula that I'm using called SumOfStepTime. I would guess that I would need to write another formula to reset things but I'm not sure just what to. My formula follows. If someone can help me to sort this out, it would be greatly appreciated.

//This formula calculates the differences between two datetimes and displays them in
//a formatted string as Days:Hours:Minuteseconds
StringVar StrTotal := "";
//assign the database values to the variables below
Datetimevar Start := {CCHScriptLogger.Time_Started};
Datetimevar End:= {CCHScriptLogger.Time_Completed} ;
NumberVar nRequestID := {CCHScriptLogger.Request_ID};
//these two dates are used to calculate just the whole number of days difference
Datevar JustDateStart := Date(Start);
Datevar JustDateEnd:= Date(End );
NumberVar DaysDiff := JustDateEnd-JustDateStart;

//assignment of each variable for individual Hour, Minute, and Second amounts
//Note: You must add to each variable to get the proper total for a running total.
NumberVar HourStart := HourStart + Hour(Start);
NumberVar MinStart := MinStart + Minute(Start);
NumberVar SecStart := SecStart + Second(Start);
NumberVar HourEnd := HourEnd + Hour(End);
NumberVar MinEnd := MinEnd + Minute(End);
NumberVar SecEnd := SecEnd + Second(End);

//intialization of variables used in calculations
NumberVar HourDiff:= 0;
NumberVar MinDiff := 0;
NumberVar SecDiff := 0;

//this section calculates the difference in hours and adjusts the DaysDiff if necessary
//in case the end day hour is less than the start day hour.
If DaysDiff >= 1 then
(
If HourStart > HourEnd Then
(
HourDiff := 24 + (HourEnd - HourStart);//adjust number of hours
DaysDiff := DaysDiff - 1;//adjust the number of days
)
else
HourDiff := HourEnd - HourStart
)
else
HourDiff := HourEnd-HourStart;


//this section calculates the difference in minutes and adjusts the HourDiff if necessary
//in case the end day minute is less than the start day minute.
If HourDiff >= 1 then
(
If MinStart > MinEnd Then
(
MinDiff := 60 + (MinEnd - MinStart);//adjust minute
(HourDiff := HourDiff - 1)//adjust hour
)
else
MinDiff := MinEnd - MinStart
)
else
MinDiff := MinEnd - MinStart;


//this section calculates the difference in seconds and adjusts the MinDiff if necessary
//in case the end day second is less than the start day second.
If MinDiff >= 1 then
(
If SecStart > SecEnd Then
(
SecDiff := 60 + (SecEnd - SecStart);//adjust seconds
(MinDiff := MinDiff - 1)//adjust minutes
)
else
SecDiff := SecEnd - SecStart
)
else
SecDiff := SecEnd - SecStart;


//This line displays the adjusted calculations in an easy to read string
//StringVar
StrTotal := Totext(DaysDiff,"00") + ":" + Totext(HourDiff,"00") + ":" + ToText(MinDiff,"00") + ":" + ToText(SecDiff,"00") ;