I can't think of an explanation as to why the ON statement would be processed different from a where join but have you tried ... from lights a, emp_list b where (a.employee=b.employee or a.employee=b.legacyemployee) and a.date=b.date group by a.date, a.employee; quit; Else, you can always try to merge 2 subqueries to kill that or statement proc sql; create table source_light as select * from ( select datepart(a.date)format Date9. as date,a.employee,a.count(a.timestamp) as Totals, sum(a.Valid) as Valid from Lights a inner join Emp_List b on (a.employee = b.employee) and a.date = b.date group by a.date, a.employee ) union select * from ( select datepart(a.date)format Date9. as date,a.employee,a.count(a.timestamp) as Totals, sum(a.Valid) as Valid from Lights a inner join Emp_List b on (a.employee = b.legacyemployee) and a.date = b.date group by a.date, a.employee ) ; quit; Not sure either will really improve the computing speed but until a better answer comes up, it is worth testing. Vincent *edit* removed the bad semi columns as depicted by PG
... View more