SELECT DISTINCTROW DAgentGroupByAgent.AgentName, DAgentGroupByAgent.AgentId, Sum(DAgentGroupByAgent.AcdCallsAnswered) AS [Sum Of AcdCallsAnswered]
WHERE (((DAgentGroupByAgent.EVENTDATE)>=[st_date] And (DAgentGroupByAgent.EVENTDATE)<[en_date]))
GROUP BY DAgentGroupByAgent.AgentName, DAgentGroupByAgent.AgentId;
SELECT DISTINCTROW tblCallRecord.AGENT, Count(tblCallRecord.AGENT) AS [Sum Of AGENT]
WHERE (((tblCallRecord.DATETIME)>=[st_date2] And (tblCallRecord.DATETIME)<[en_date2]))
GROUP BY tblCallRecord.AGENT;
I am passing st_date and en_date as parameters to make the two queries dynamic. When I run both queries, I get the results that I want with no issues.
The issue is when I run my third query to query the other 2 queries:
SELECT [qryACDCallsAns].[AgentName], [qryCallsAcctFor].[Sum of Agent] AS [Calls Acctd For], [qryACDCallsAns].[Sum of ACDCallsAnswered] AS [ACD Calls Ansd]
FROM qryACDCallsAns LEFT JOIN qryCallsAcctFor ON INT([qryACDCallsAns].AgentID) = INT([qryCallsAcctFor].Agent);
It prompts me for 4 parameters which are st_date, en_date, st_date2 and en_date2 and then gives me the following error in MS Access:
This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables. (Error 3071)
I am running this in MS Access. The variables are being passed when I double-click the query to run it, it then asks me to enter in the parameter values.
After I enter the dates for the parameters, then the query takes those values and produces the results of the query. It works fine for the first two queries but gives me an error on the third query (which is basically a query that queries the other two queries).
I am actually passing the date variables from an asp page. So, I don't think I will need a form in access.
When I received an error on the asp page originally, I tried to test it in Access and discovered the underlying error. So, if I can get it to work in MS Access first, then I beleive it should work on my asp page.