Jump to content

PHP Help


Morty880

Recommended Posts

I have a database of timecards, looks like this:

 

userid start time end time totalmins lunch lunchmins

 

Everytime an employee punches in/out it creates a new entry.

 

Example - Employee started at 8AM, went to lunch at 12PM, at lunch for 30mins, returned at 1230PM, went home at 430PM.

1 2013-02-21 08:00:00 2013-02-21 12:00:00 240 1 30

1 2013-02-21 12:30:00 2013-02-21 16:30:00 240 0 0

 

I have 2 entries for every employee, every work day since Jan 2nd.

 

Now I made a change, the database looks like this using the same example above

 

userid start time end time totalmins lunchout lunchin lunchmins

1 2013-02-21 08:00:00 2013-02-21 16:30:00 510 2013-02-21 12:00:00 2013-02-21 12:30:00 30

 

Now I have 1 enrty per employee, per day.

 

 

Question, how do you think I could take the old entries and combine them into 1 entry using the new format???

 

Example from data above

 

Start time is fine, in same entry lunchout needs to be the checkouttime from the old data, lunchin needs to be the checkintime from the old data (2nd entry from the same day), and the checkout time needs to be checkouttime from the old data (2nd entry from the same day).

Link to comment
https://forums.phpfreaks.com/topic/274791-php-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.