Post the SQL from the 2 Queries. How are the values for Month and Operation transferred to the 2 Queries?
I have a form called selection that has 3 textboxes which are txtstartdate, txtenddate, and txtopcode for user to input the information.
here is the query to calculate the total hours: (I create regular query, but here is the SQL view):
SELECT labor_ticket.DATE, Sum(labor_ticket.HOURS_WORKED) AS SumOfHOURS_WORKED, Opcode.Department, Opcode.Opcode, (Format([DATE],"mm"" '""yy")) AS months_total
FROM LABOR_TICKET INNER JOIN Opcode ON LABOR_TICKET.RESOURCE_ID = Opcode.Opcode
GROUP BY LABOR_TICKET.DATE, Opcode.Department, Opcode.Opcode, (Format([DATE],"mm"" '""yy"))
HAVING (((LABOR_TICKET.DATE) Between ([forms]![selection]![Txtstartdate]) And ([forms]![selection]![Txtend])) AND ((Opcode.Opcode)=[([forms]![selection]![Txtopcode]))
ORDER BY LABOR_TICKET.DATE, Opcode.Department;
and here is the query to calculate the total unattended hours:
SELECT LABOR_TICKET.DATE , Sum(LABOR_TICKET.HOURS_WORKED) AS Unattended, Opcode.Department, Opcode.Opcode,(Format([DATE],"mm"" '""yy")) AS months_unattended
FROM LABOR_TICKET INNER JOIN Opcode ON LABOR_TICKET.RESOURCE_ID = Opcode.Opcode
WHERE (((LABOR_TICKET.EMPLOYEE_ID) Like "8*"))
GROUP BY LABOR_TICKET.DATE, Opcode.Department, Opcode.Opcode, (Format([DATE],"mm"" '""yy"))
HAVING (((LABOR_TICKET.DATE) Between ([forms]![selection]![Txtstartdate]) And ([forms]![selection]![Txtend])) AND ((Opcode.Opcode)=[([forms]![selection]![Txtopcode]))
ORDER BY LABOR_TICKET.DATE, Opcode.Department;
what I need is to create a chart report that consists total hours and total unattended hours values. could we use 2 queries in the chart report? Please help.
Thank you so much