I have a query that will take about 10mins to run the first 100 TimeIDs but get a memory error if I try to run first 1000 (I actually need to run all 27,000 TimeIds).
The subquery multiplies 12 probabilities together to get a product (there are 500,000 of these products for each TimeId). Then the Make table query sums these products to get the 1 SumOfProduct for each TimeID.
Make Table Query:
SELECT [OverallResult Product].TimeID, Sum([OverallResult Product].ProductOfProbability) AS SumOfProductOfProbability INTO [Result2 Time100]
FROM [OverallResult Product]
GROUP BY [OverallResult Product].TimeID;
This is the subquery called OverallResult Product:
SELECT tblProbablility.TimeID, Exp(Sum(Log([tblProbablility].[Probablility]))) AS ProductOfProbability
FROM tblOverall INNER JOIN (tblPossible LEFT JOIN tblProbablility ON (tblPossible.MatchID = tblProbablility.MatchID) AND (tblPossible.WinnerID = tblProbablility.WinnerID)) ON tblOverall.PossibleID = tblPossible.PossibleID
GROUP BY tblProbablility.TimeID, tblOverall.OverallResult, tblPossible.PossibleID
HAVING (((tblProbablility.TimeID)<101) AND ((tblOverall.OverallResult)=2));
I know it is huge, but am I writing the SQL inefficiently or will Access never be able to do it?
If Access isn't capable, would it work if I find someone who has and knows SQL server?
The subquery multiplies 12 probabilities together to get a product (there are 500,000 of these products for each TimeId). Then the Make table query sums these products to get the 1 SumOfProduct for each TimeID.
Make Table Query:
SELECT [OverallResult Product].TimeID, Sum([OverallResult Product].ProductOfProbability) AS SumOfProductOfProbability INTO [Result2 Time100]
FROM [OverallResult Product]
GROUP BY [OverallResult Product].TimeID;
This is the subquery called OverallResult Product:
SELECT tblProbablility.TimeID, Exp(Sum(Log([tblProbablility].[Probablility]))) AS ProductOfProbability
FROM tblOverall INNER JOIN (tblPossible LEFT JOIN tblProbablility ON (tblPossible.MatchID = tblProbablility.MatchID) AND (tblPossible.WinnerID = tblProbablility.WinnerID)) ON tblOverall.PossibleID = tblPossible.PossibleID
GROUP BY tblProbablility.TimeID, tblOverall.OverallResult, tblPossible.PossibleID
HAVING (((tblProbablility.TimeID)<101) AND ((tblOverall.OverallResult)=2));
I know it is huge, but am I writing the SQL inefficiently or will Access never be able to do it?
If Access isn't capable, would it work if I find someone who has and knows SQL server?