Got it...Thanks Srinivas! select count(*) as 'Total closed for range', Priority_type_name 'Priority', location_name 'Cient', email 'Engineer' , AVG(datediff(d,report_date,last_status_update_time )) AS [Avaerage time open] from job_ticket j inner join priority_type p on p.priority_type_id = j.priority_type_id inner join tech t on t.client_id = j.assigned_tech_id inner join location l on l.location_id = j.location_id where (last_status_update_time between @startdate and @enddate) and status_type_id ='3' group by l.location_name, t.email, p.Priority_type_name
Regards, Hulicat