473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to calculate break hours from in/out details in php?

Hello All,

i want to need Idea about how to calculate break hours from in/out details


In My Database Design is:

ID EmpEntryDate EmpInTime EmpOutTime Empid
1 2014-09-22 10:28 13:21 209
2 2014-09-22 14:04 18:27 209


Break Hours : 0.47

In Below CODE i just given total sum No break Hours

Expand|Select|Wrap|Line Numbers
  1. SELECT `EmpEntryDate` , TIME_FORMAT( SEC_TO_TIME( SUM( TIMEDIFF( `EmpOutTime` , `EmpInTime` ) ) ) , "%h:%i" ) AS TOTAL_SEC
  2. FROM attemppresentdetail
  3. WHERE `Empid` = '209'
  4. AND `EmpEntryDate` = '2014-09-22'
  5. LIMIT 0 , 30
  6.  
TOTAL_SEC : 06:46

Thanks
Sep 22 '14 #1
2 1354
Rabbit
12,516 Expert Mod 8TB
Join the table to itself so you can join one record to the next. That will give you the current record's out time and the next record's in time, allowing you to calculate the difference between the two.
Sep 22 '14 #2
Hello Rabbit,

Thanks For reply ,

can you please show me any example or demo so i can understand easily.
Sep 23 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: sg_s123 | last post by:
============================================================================ 02-Feb-04 03-Feb-04 Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr- 1900hr- Number...
1
by: Don G | last post by:
Each entry in a data file includes date and time in text format - e.g. "0601271325" = 2006, January 27th, 1:25 pm. Is there a simple way to calculate the hours (including decimal parts) between...
1
by: deena22 | last post by:
hello, i'm using 'Access database' and VB 6.0. My database is named ' timesheet' and it contains a table named 'tabletimesheet'. The table contain the following fields: 'staffname, stafftype,...
1
by: billa856 | last post by:
Hi, I have one project in MS Access. In that I have one form in which I am using one combobox and one search button. Now when I select an item from that combobox and press the submit button then...
3
by: iceone | last post by:
Hi everybody, I am monitoring a call center and i need to calculate the working hours between the moment the call is answered and the moment the call is closed. i need to calculate the working...
1
by: Andrew G. Koptyaev | last post by:
Is exist metod to calculate work hours for implementing project. May be some hours per kb ? Somebody want to hair me to do project but I dont know how much hours I will spend. Thank you!
26
by: Bill Sublette | last post by:
Okay so here's situation. I have an Access 2003 Report that builds off of a Query which pulls from a Table which is populated by a form... The data is the employee (name), the hours they worked for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.