I answered this but, once again, this forum is throwing away my posts!
Grumble!
I'm not positive, but I *THINK* you just have a misplaced right paren.
Try this:
Code:
insert into #Combined_LaborHrsDetailTable
(jobdate, costcode, employeename, equipmentid, equipmentname, jdeequipmenthours)
select t2.jde_job_date, t2.jde_cost_code, t2.jde_employee_name,
t2.jde_equipment_id, t2.jde_equipment_name, t2.jde_equipment_hours
from #JDE_LaborHrsDetailTable AS t2
where not exists (
select * from #Combined_LaborHrsDetailTable AS t1
where t1.jobdate = t2.jde_job_date
and t1.equipmentid = t2.jde_equipment_id
and t1.employeename = t2.jde_employee_name
and t1.eqequipmenthours = t2.jde_equipment_hours
)
and t2.jde_equipment_hours > 0
.