Fix issue where upload stats were taking hours to generate dsc-791

This works by making the sql report work again. It needed an extra join on the jobitems table.