Hello all
Is there any sensible reason why this query should take like 20 minutes to run.. other than that we use Citrix!
I mean I know this is a basic query (just a conditional count) but am I doing something stupid here?
SELECT TBL_Agreements.IDAgent, Count(TBL_MeasuresInstalled.IDMeasure) AS CountOfIDMeasure, TBL_Agents.AgentType
FROM TBL_MeasuresInstalled INNER JOIN TBL_Submissions ON TBL_MeasuresInstalled.IDSubmission = TBL_Submissions.IDSubmission, TBL_Schemes INNER JOIN (TBL_Agents INNER JOIN TBL_Agreements ON TBL_Agents.IDAgent = TBL_Agreements.IDAgent) ON TBL_Schemes.IDScheme = TBL_Agreements.IDScheme
GROUP BY TBL_Agreements.IDAgent, TBL_Agents.AgentType, TBL_Schemes.IDProgram
HAVING (((TBL_Schemes.IDProgram)=3));
Is there any sensible reason why this query should take like 20 minutes to run.. other than that we use Citrix!
I mean I know this is a basic query (just a conditional count) but am I doing something stupid here?
SELECT TBL_Agreements.IDAgent, Count(TBL_MeasuresInstalled.IDMeasure) AS CountOfIDMeasure, TBL_Agents.AgentType
FROM TBL_MeasuresInstalled INNER JOIN TBL_Submissions ON TBL_MeasuresInstalled.IDSubmission = TBL_Submissions.IDSubmission, TBL_Schemes INNER JOIN (TBL_Agents INNER JOIN TBL_Agreements ON TBL_Agents.IDAgent = TBL_Agreements.IDAgent) ON TBL_Schemes.IDScheme = TBL_Agreements.IDScheme
GROUP BY TBL_Agreements.IDAgent, TBL_Agents.AgentType, TBL_Schemes.IDProgram
HAVING (((TBL_Schemes.IDProgram)=3));