Loading
  1. SELECT CONCAT(time_recorder_users.user_first_name, ' ', time_recorder_users.user_last_name) AS first_last, time_recorder_operations.operation_name, time_recorder_tasks.task_name, time_recorder_customers.customer_name, time_recorder_farms.farm_name, time_recorder_jobs.start_time, time_recorder_jobs.end_time, time_recorder_jobs.output, time_recorder_jobs.comments, TIMESTAMPDIFF(MINUTE,time_recorder_jobs.start_time,time_recorder_jobs.end_time) AS MinutesTaken
  2. FROM time_recorder_jobs
  3. INNER JOIN time_recorder_users ON time_recorder_jobs.user_id = time_recorder_users.user_id
  4. INNER JOIN time_recorder_companies ON time_recorder_users.company_id = time_recorder_companies.company_id
  5. INNER JOIN time_recorder_operations ON time_recorder_jobs.operation_id = time_recorder_operations.operation_id
  6. INNER JOIN time_recorder_tasks ON time_recorder_jobs.task_id = time_recorder_tasks.task_id
  7. INNER JOIN time_recorder_customers ON time_recorder_jobs.customer_id = time_recorder_customers.customer_id
  8. INNER JOIN time_recorder_farms ON time_recorder_jobs.farm_id = time_recorder_farms.farm_id
  9. WHERE (time_recorder_jobs.deleted = 0) AND (time_recorder_users.company_id = 2)
  10.  
  11. AND (time_recorder_jobs.start_time >= '2014-05-18' AND time_recorder_jobs.end_time <= '2014-05-20')
  12.  
  13. ORDER BY time_recorder_jobs.end_time DESC

Comments