G
Guest
I have been working with a query that reads from another query the max data
where that query's date is <= to the date of each item of my query.
It does work, but it is too slow!
How can I make the same thing mor efficient?
Thanks a lot, Lina
SELECT qry_Rslts_UnitsProductionForecastingTmp.IdPrdctByCmpny,
qry_Rslts_UnitsProductionForecastingTmp.Date,
qry_Rslts_UnitsProductionForecastingTmp.CumulativeQuantitySales,
(Select max(TempCumulativeQuantityProduction) as MAXQtity From
qry_Rslts_UnitsProductionForecastingTmpM where
qry_Rslts_UnitsProductionForecastingTmp.IdPrdctByCmpny=qry_Rslts_UnitsProductionForecastingTmpM.IdPrdctByCmpny
having
qry_Rslts_UnitsProductionForecastingTmp.Date>=qry_Rslts_UnitsProductionForecastingTmp.Date) AS CumulativeQuantityProduction
FROM qry_Rslts_UnitsProductionForecastingTmp;
where that query's date is <= to the date of each item of my query.
It does work, but it is too slow!
How can I make the same thing mor efficient?
Thanks a lot, Lina
SELECT qry_Rslts_UnitsProductionForecastingTmp.IdPrdctByCmpny,
qry_Rslts_UnitsProductionForecastingTmp.Date,
qry_Rslts_UnitsProductionForecastingTmp.CumulativeQuantitySales,
(Select max(TempCumulativeQuantityProduction) as MAXQtity From
qry_Rslts_UnitsProductionForecastingTmpM where
qry_Rslts_UnitsProductionForecastingTmp.IdPrdctByCmpny=qry_Rslts_UnitsProductionForecastingTmpM.IdPrdctByCmpny
having
qry_Rslts_UnitsProductionForecastingTmp.Date>=qry_Rslts_UnitsProductionForecastingTmp.Date) AS CumulativeQuantityProduction
FROM qry_Rslts_UnitsProductionForecastingTmp;