title: I have estimated time on a job but when I add the employee's (in this case 2) hours, it will duplicate the estimated
body: <p>I have estimated time on a job but when I add the employee's (in this case 2) hours, it will duplicate the estimated. I need to divide by the number of results (maybe employee records) to get the correct answer.</p>
  
  <p>SQL pull from database.</p>
  
  <pre><code>SELECT
       LaborDtl.JobNum,
       LaborDtl.ClockInDate,
       LaborDtl.OprSeq,
       EmpBasic.Name,
       (LaborDtl.LaborHrs) as [TotalHrs],
       ((JobOper.EstSetHours + JobOper.EstProdHours) / (COUNT (EmpBasic.Name))) as [TotEstHrs],
       LaborDtl.ResourceGrpID
  FROM Erp.LaborDtl
  
  left outer JOIN Erp.JobOper ON
     JobOper.JobNum = LaborDtl.JobNum
     AND JobOper.OprSeq = LaborDtl.OprSeq
  JOIN Erp.EmpBasic ON
     EmpBasic.EmpID = LaborDtl.EmployeeNum
  WHERE LaborDtl.Complete = '1'
     AND LaborDtl.ClockInDate = '2019-7-1'
     AND LaborDtl.ResourceGrpID = '5-XM-C'
     AND LaborDtl.JobNum = 'PA16742'
  
  GROUP BY 
  LaborDtl.JobNum,
  LaborDtl.ClockInDate,
  LaborDtl.OprSeq,
  EmpBasic.Name,
  LaborDtl.LaborHrs,
  JobOper.EstSetHours,
  JobOper.EstProdHours,
  LaborDtl.EmployeeNum,
  LaborDtl.ResourceGrpID
  
  JobNum  ClockInDate OprSeq  Name        TotalHrs  TotEstHrs ResourceGrpID
  pa16742 2019-07-01  20      Jerry Adam  1.6300    5.00      5-XM-C
  PA16742 2019-07-01  20      Xue Lee     2.68000   5.00      5-XM-C
  </code></pre>
  
  <p>In this case, the TotEstHrs should be 2.5 on each line.</p>