Query Help - Display numbers from two Months
I am trying to make a very simple report.
I want to display billable hours for each Rep for both this month and last month on this report. I have two queries (not sure if I can do it on one Query or not) One query has the criteria month(date()) and the other one has Month(Date())-1.
I guess there are two questions:
1. Can I get both values from one Query?
2. How can I display both numbers on one report.
Thanks for the help.
Here is the SQL View of my Queries.
SELECT DISTINCTROW Rep.FirstName, Sum(WorkorderTime.WorkOrderTime) AS [Sum Of WorkOrderTime]
FROM Rep RIGHT JOIN WorkorderTime ON Rep.RepID = WorkorderTime.RepId
GROUP BY Rep.FirstName, Month([WorkOrderDate])
HAVING (((Month([WorkOrderDate]))=Month(Date())));
SELECT DISTINCTROW Rep.FirstName, Sum(WorkorderTime.WorkOrderTime) AS [Sum Of WorkOrderTime]
FROM Rep RIGHT JOIN WorkorderTime ON Rep.RepID = WorkorderTime.RepId
GROUP BY Rep.FirstName, Month([WorkOrderDate])
HAVING (((Month([WorkOrderDate]))=Month(Date())-1));
|