Results 1 to 2 of 2

Thread: MYSQL measuring time

  1. #1
    Join Date
    Jun 2005

    Question MYSQL measuring time

    Hi there,
    I would like to measure the time spent doing a task during a specified period (e.g. 8 hr shift.) The table is structured as follows:

    id, emp_no, task_id, start_date;

    Each time someone starts a new task they submit to the above table. The start_date is also the end_date for the previous task.

    Is this table design adequate? How do I query the db so as to get the total time per task and the time each person spent doing a task?

    Thanks in advance!!

  2. #2
    Join Date
    Feb 2003
    You need separate fields for start date and end date. What if the person finishes a task, goes to lunch, and then starts a new task? You've just counted lunch as part of the task time of the previous task.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts