0
votes

I am designing crystal report with a column having time duration.

I have column like Empcode, name, duration, remarks, etc.

I am grouping report according to empcode.

I want to display sum of duration in group footer.

I have two formulae for that...

  1. @get_seconds :

        local stringvar array completetime;
        local numbervar totalseconds;
        completetime:=split({DailyAttendance.TotalDuration},":");
        totalseconds:= (3600*cdbl(completetime[1])) + (60*cdbl(completetime[2]));
    
  2. @total_duration :

       replace(cstr(Sum ({@get_seconds})\3600),".00","") 
       + ":" +  replace(cstr((Sum ({@get_seconds}) mod 3600)/60),".00","")
    

I am displaying @total_duration in group footer, but i am getting sum of all records in report, not sum of records in group only. Can someone tell me how to achieve this??

Thanks..

1

1 Answers

0
votes

Got my solution, I just Updated my formula as:

@total_duration :

replace(cstr(Sum({@get_seconds}, {DailyAttendance.EmpCode})\3600),".00","") + " Hrs " + replace(cstr((Sum ({@get_seconds}, {DailyAttendance.EmpCode}) mod 3600)/60),".00","") + " Mins"

Thanks..