This topic is locked

Calculate time

7/18/2008 4:36:33 PM
PHPRunner General questions
W
wisdom2009 author

I am trying to calculate the time between the first logout and the second login to calculate how long break time, per example, if i start working 1/4/2008 8:40 am than logout at 1/4/2008 10:48am to take a break for 15 Minutes, when the break is over i logged back on at 1/4/2008 11:05. so i would like to see the calculation [1/4/2008 11:05] - [1/4/2008 10:48] = 0:17:23

Please see the table as an example, now i am using Excel to make this calculation happened which is a manual process. i hope someone will help be me with this , because i was trying to do this since a very long time.
Date logid LastName FirstName logintime logouttime Break Time

1/4/2008 0000 Bruce Jay 1/4/2008 8:40 1/4/2008 10:48 0:17:23

1/4/2008 0000 Bruce Jay 1/4/2008 11:05 1/4/2008 13:35 0:29:43

1/4/2008 0000 Bruce Jay 1/4/2008 14:05 1/4/2008 16:04 0:16:09

1/4/2008 0000 Bruce Jay 1/4/2008 16:20 1/4/2008 17:16 END
Thanks you very much

J
JHN 7/18/2008

You will need to do that in your database. For instance if you used access this code would work:
[codebox]SELECT time.ID, time.time_in, time.time_out,

DateDiff('n',[time_in],[time_out]) AS tot_time

FROM [time]

GROUP BY time.ID, time.time_in, time.time_out;

[/codebox]
Hope that helps
Joey

W
wisdom2009 author 7/22/2008

Hi Joey,
thanks for your reply, i did that on my database, but it did not work, i calculate only the diffirent time between the first login and next logout. what i wanted is calculate how long they took break but now how long they was connected, as on the exampled i mentioned if logged on at 1/4/2008 8:40 than logout at 1/4/2008 10:48 0:17:23 to take a break, than after that logged back on at 1/4/2008 11:05 so i want to calculate the time that they was on break for this example will be from 1/4/2008 10:48 0:17:23 ( time they logged off firsttime) - 1/4/2008 11:05 (time when they logged back on) which is will be :

[1/4/2008 11:05][color="#FF0000"] - = 0:17:23
I hope i explained this well
Thanks