Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding times in CR 10 1

Status
Not open for further replies.

Delphin

Programmer
Nov 27, 2001
134
US
I retrieve the durations of calls for a specific person. I am not sure how to add the durations together to get the total amount of time on the phone per day.

I tried converting to seconds, which i can get the total number of seconds, but now i cannot convert back. I feel like an idiot, but Can I either convert the total number of seconds back to HH:MM:SS or how do i just add the time durations for each person?

Billy Ballard

For in the past, Lies the future.
 
You should post technical information:

Crystal version
database/connectivity
example data
expected output

Here's my FAQ on dealing with seconds and the display you seek, it should resolve:

faq767-3543

-k
 
I am using Crystal 10 conection to SQL server... the only imput coming across is 00:00:30 for 30 sec.

I have a caller that makes 50 calls in 1 day.

It is imputed as
00:01:11
00:01.09
00:00:40

Total 00:03:00

looking for a total of all the calls made for the day and the month. The export that is imputed give the date diff for each call. I need to add all of those up and report on it daily amnd monthly per person

Billy Ballard

For in the past, Lies the future.
 
You have created a formula to convert your time field to seconds. It might look something like {@seconds}:

datediff("s",datetime(0,0,0,0,0,0),datetime(date(0,0,0),{table.time}))

And you have a group on {table.person}. Then you would SV's formula like this:

numberVar dur := sum({@seconds},{table.person});
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00");

hhmmss

Substitute your correct formula name and your field for {table.person}.

-LB
 
You stated that you already had it in seconds, so plug it into the formula and you're done at whatever levels appropriate.

Note that lb's solution is valid for the person level, providing you group by person, or you can just use the seconds at whatever level you'd like.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top