Suggestions For Slow Query

S

SthOzNewbie

Hi All,

Any suggestion for how I can make this query run any faster would be much
appreciated. It is set as a Make Table query as I need to run further queries
on the output and it is already painfully slow.

SELECT tblChWidthSumm.ID, tblChWidthSumm.LocCode, tblChWidthSumm.RevItem,
tblChWidthSumm.NormLength, tblChWidthSumm.ChWidth,
tblChWidthSumm.SumOfCheeses, (SELECT sum([SumOfCheeses])FROM [tblChWidthSumm]
AS [tbl2] WHERE([tbl2].[ID] <= [tblChWidthSumm].[ID]) And
([tbl2].[NormLength] = [tblChWidthSumm].[NormLength]) And ([tbl2].[RevItem] =
[tblChWidthSumm].[RevItem]) And ([tbl2].[LocCode] =
[tblChWidthSumm].[LocCode]))/(SELECT sum([SumOfCheeses])FROM [tblChWidthSumm]
AS [tbl2] WHERE ([tbl2].[NormLength] = [tblChWidthSumm].[NormLength]) And
([tbl2].[RevItem] = [tblChWidthSumm].[RevItem]) And ([tbl2].[LocCode] =
[tblChWidthSumm].[LocCode])) AS [Pareto%], qrySWOPDownload.Type INTO
tblCumCheeses
FROM tblChWidthSumm LEFT JOIN qrySWOPDownload ON (tblChWidthSumm.ChWidth =
qrySWOPDownload.Width) AND (tblChWidthSumm.NormLength =
qrySWOPDownload.Length) AND (tblChWidthSumm.RevItem = qrySWOPDownload.Spec)
AND (tblChWidthSumm.LocCode = qrySWOPDownload.Location);

TIA,

IK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top