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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADDING HOURS & MINS IN CRYSTAL

Status
Not open for further replies.

michele9357

IS-IT--Management
Jun 25, 2008
5
0
0
US
I have a group with different times - I want to total the times for each group. See below

Group1 --- John Doe Total time
Detail --- IN-7:27 Out 8:23 0:56
IN-10:40 Out 11:42 1:02

I used this formula to get the Total Time -
Time (0,0,0)+(Time({casemain.actcase_stop_datetime})-Time({casemain.actcase_start_datetime}))
How do I add the 2 total times together. I know this is probably an easy answer, i am stuck... please help.

 
Your formula would not have resulted in the total time you are displaying. What is the actual formula?

If you use this formula:

Time({casemain.actcase_stop_datetime})-Time({casemain.actcase_start_datetime})

...it will return seconds. You can place it in the detail section->right click on it and insert a sum on it at the group level. Then convert the seconds back into the string you are showing. You can use the formula in faq767-3543 to do this.

-LB
 
I used this to get my total Seconds -
Time({casemain.actcase_stop_datetime})-Time({casemain.actcase_start_datetime})
and now i have a total "Group" Sec - it is a "number" and i can't seem to change it to time- HH:MM
Group1 --- John Doe Total time
Detail --- IN-7:27 Out 8:23 0:56 (these #'s are time)
IN-10:40 Out 11:42 1:02

actual start actual stop total time (all time fields)
6:50 7:21 0:31
7:29 8:42 1:13
total seconds 6240 (number field) I want this to be HH & MM

I don't know how to really explain - does this make sense?
 
I THINK I DID IT!!!!!!!!!! THANK YOU !!!! FINALLY I GOT WHAT YOU WERE SAYING.....
 
Now my numbers are strings - how do i add them together????
 
You always have to do the addition with the seconds. If your time difference formula is called {@diff}, then you would set the variable "dur" in the faq formula to:

numbervar dur := sum({@diff},{table.groupfield});

-LB
 
PS. Please note that your total time field is NOT a time. It is a string field formatted to appear as if it were a time.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top