Print Page | Close Window

sum of time by group

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21984
Printed Date: 28 Apr 2024 at 11:43pm


Topic: sum of time by group
Posted By: Kevinbwdsb
Subject: sum of time by group
Date Posted: 01 Jun 2016 at 9:32am
I'm looking for a way to calculate the amount of time spent on calls by week. I have groups for week beginning on Sunday, that groups all the calls for that week - works fine. I have a summary to count the number of calls each week, but I need a way to calculate the amount of time spent on those calls that week. A summary works but I can't seem to figure out how to display it as hh:mm instead of a number? I don't want this is in the footer as it wouldn't make sense.

Right now I get
Week 1 - 15 calls 876
week 2 - 30 calls 480
Week 3 - 90 calls 1,987

I'd like it displayed as
Week 1 - 15 calls 14hrs, 36 minutes
week 2 - 30 calls 8hrs
Week 3 - 90 calls 33hrs, 7 minutes

Thanks in advance
Kevin



Replies:
Posted By: kevlray
Date Posted: 01 Jun 2016 at 9:40am
I use a formula to convert from seconds to hours/minutes.

totext(truncate(avgtime/3600,0),0,"")+":"+totext(truncate(avgtime/60,0)-(truncate(avgtime/3600,0)*60),"00",0,"")

Maybe not the best solution, but it works for me.


Posted By: Kevinbwdsb
Date Posted: 07 Jun 2016 at 4:37am
Perfect with a little tweaking I am able to get the info I needed in the format I want!

Thanks
Kevin



Print Page | Close Window