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

Converting number into hour minutes 1

Status
Not open for further replies.

newbie0423

IS-IT--Management
Oct 29, 2012
103
US
Hello Experts,

I have a report that is showing the time a nurse went into a room and the time the nurse came out of the rooom. I am using a formula to get the total minutes the nurse was actually in the room.
@nursedifftime
DateDiff ("n",DateTime(CDate ("November 10, 1999"),{@nurseintime}),DateTime(CDate ("November 10, 1999"),{@nurseouttime}) )
and then I'm doing a count on the total minutes per week the nurse spends in each room

Nurse A IN Room Out Room total time
8:00 8:30 30
9:00 10:00 60
10:30 11:00 30
11:15 12:00 45
Total 165 would like this to say 2 hours and 45 mins
How can this be accomplished? I have tried to follow some of the previous post. but I have not found one that deals with times in this way.
 
Hi Ian,
thank you for all of your help. I did everything as you stated above, and i am still getting the results for the last number.

45
16
48
75
38
53
37
45
14
35

0 hours 35 minutes
 
Hi Ian,
I got it to work! I needed didn't have the @eval in the grp header. Thank you so much!
 
I meant to say I needed to put @eval in the details. I am getting some incorrect times in the details.
 
if possible, I would like to have some additional help with this. I don't know if I'm suppose to re-post but here it goes. I thought my issue was resolved but as I looked at the numbers I saw that the times were not calculating properly. and it seems to be calcualting the last number. I followed the formulas correctly and placed them in the appropriate places. Can someone tell me what I'm doing wrong?

In time Out time
11:30 12:07 37
9:37 9:52 52
10:51 11:08 69
12:14 13:00 115
10:06 10:21 130
10:43 10:48 135
13:00 13:34 169
total 2hr 49min
 
Please show the contents of the formula {@nursedifftime}, {@nurseintime} and {@nurseouttime}.


Pete

 
@nurseintime TimeValue (replace(left(CStr ({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}),Length (cstr({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}))-5),",","") & ":" & Left(Right(CStr ({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}),5),2))


@nurseouttime TimeValue (replace(left(CStr ({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}),Length (cstr({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}))-5),",","") & ":" & Left(Right(CStr ({v_CRA_circulator_times_orcr.time_out_of_case_circ_rn}),5),2))


@nursedifftime DateDiff ("n",DateTime(CDate ("November 10, 1999"),{@nurseintime}),DateTime(CDate ("November 10, 1999"),{@nurseouttime}) )
 
My testing confirms that the DateDiff function returns a number, which means it should be possible to sum it and convert the result (ie, the total minutes) to hours and minutes using the code I provided previously.

As a test, can you try adding a simple summary (Sum of {@nursedifftime}). If that works, the code provided in my earlier post should provide the solution without the need to resort to variables. Simply create a new formula (@TotalTime) using that code and place it in the report footer (or group footer if amended as suggested).

Cheers
Pete
 
Pete thank you very much for responding. The formula (Sum of {@nursedifftime} returns a number 5,875 and your code about returns 97hours and 55 minutes for all records.
 
Thank you for responding. I did that and I am getting the total minutes. Not hours and minutes.
 
Yes, I used it and it is working to give me the total minutes. Thanks Pete and Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top