G
Guest
I need HELP
I have a query with a subquery that is giving me an error message.
I am trying to sum the sales from years and months before the actual.
I have tried Dsum, but it is too slow.
Can any one help me??? Please!
This is my query:
SELECT qry_Rslts_SalesForecasting.IdPrdctByCmpny,
qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month,
CDate(DateSerial([Year],[Month],1)) AS [Date],
qry_Rslts_SalesForecasting.SalesQuantity AS QuantitySales, (Select
sum(SalesQuantity) as SUMA From qry_Rslts_SalesForecasting2 where
qry_Rslts_SalesForecasting2.Date>qry_Rslts_SalesForecasting.Date) AS Calculo
FROM qry_Rslts_SalesForecasting
GROUP BY qry_Rslts_SalesForecasting.IdPrdctByCmpny,
qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month,
qry_Rslts_SalesForecasting.SalesQuantity, (Select sum(SalesQuantity) as SUMA
From qry_Rslts_SalesForecasting2 where
qry_Rslts_SalesForecasting2.Date>qry_Rslts_SalesForecasting.Date)
ORDER BY qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month;
I have a query with a subquery that is giving me an error message.
I am trying to sum the sales from years and months before the actual.
I have tried Dsum, but it is too slow.
Can any one help me??? Please!
This is my query:
SELECT qry_Rslts_SalesForecasting.IdPrdctByCmpny,
qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month,
CDate(DateSerial([Year],[Month],1)) AS [Date],
qry_Rslts_SalesForecasting.SalesQuantity AS QuantitySales, (Select
sum(SalesQuantity) as SUMA From qry_Rslts_SalesForecasting2 where
qry_Rslts_SalesForecasting2.Date>qry_Rslts_SalesForecasting.Date) AS Calculo
FROM qry_Rslts_SalesForecasting
GROUP BY qry_Rslts_SalesForecasting.IdPrdctByCmpny,
qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month,
qry_Rslts_SalesForecasting.SalesQuantity, (Select sum(SalesQuantity) as SUMA
From qry_Rslts_SalesForecasting2 where
qry_Rslts_SalesForecasting2.Date>qry_Rslts_SalesForecasting.Date)
ORDER BY qry_Rslts_SalesForecasting.Year, qry_Rslts_SalesForecasting.Month;