Getting latest count quantities

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hello All,
I'm trying to get the latest stocktake quantity and the latest
stocktake date from my tables.
Where am I going wrong?
Thanks,
Mark
The below is from the SQL view of my query
SELECT tblResources.ResourceName, Max([tblStockTake].[StockTakeDate])
AS CountDate, tblStockTake.Quantity
FROM tblResources INNER JOIN tblStockTake ON tblResources.ResourceID =
tblStockTake.ResourceID;
 
Hi,

You are missing a GROUP BY clause and/or aggregates. You probably
miss:
GROUP BY tblResources.ResourceName
but there is still the problem with tblStockTake.Quantity

Take a look at http://www.mvps.org/access/queries/qry0020.htm


In a Total query, each field in the SELECT clause must be aggregated
(MIN, MAX, COUNT, SUM, FIRST, LAST, ... ) or appear in the GROUP BY clause.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top