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
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