View Single Post
  #1  
Old December 30th, 2009, 05:11 PM posted to microsoft.public.access.queries
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default How to add another field to a max query result without grouping

I am trying to create a query to find the most recent locationID for each
item with a TrkID

but i can only seem to get it with two queries then join it back on lochist
date and TRKiD Is this the best way??
Here is the query to get the max date for each TRKID isnt there a clean way
to add in one more field "LocationID" ??

SELECT TRKID, Max(T_LocationHistory.LocHistDate) AS MaxOfLocHistDate
FROM T_LocationHistory
GROUP BY TRKID;

if i do i get the max date for each unique TrkID and LocationID combo

Thanks