473,378 Members | 1,482 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,378 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 1350
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.