I am utilizing the following query to deliver some numbers for a specific date range. Now I need to include the same data but without a date range into the same report. What would be the best way to do this?
SELECT company.company_name, COUNT(service_req.id) AS Expr1, cust_values.value_caption
FROM service_req INNER JOIN
sysaid_user ON service_req.submit_user = sysaid_user.user_name INNER JOIN
cust_values ON service_req.status = cust_values.value_key LEFT OUTER JOIN
company ON sysaid_user.company = company.company_id
GROUP BY company.company_name, service_req.insert_time, service_req.close_time, cust_values.value_caption, cust_values.list_name
HAVING (service_req.insert_time >= @start_date) AND (cust_values.list_name = N'Status') AND (service_req.insert_time <= @finish_date)
ORDER BY company.company_name
SELECT company.company_name, COUNT(service_req.id) AS Expr1, cust_values.value_caption
FROM service_req INNER JOIN
sysaid_user ON service_req.submit_user = sysaid_user.user_name INNER JOIN
cust_values ON service_req.status = cust_values.value_key LEFT OUTER JOIN
company ON sysaid_user.company = company.company_id
GROUP BY company.company_name, service_req.insert_time, service_req.close_time, cust_values.value_caption, cust_values.list_name
HAVING (service_req.insert_time >= @start_date) AND (cust_values.list_name = N'Status') AND (service_req.insert_time <= @finish_date)
ORDER BY company.company_name