Originally Posted by
tagteam
I have done as ArvilLaanemets suggested and the query does run quickly. However, the problem is that with the join it creates 1,097 copies of railcar 1 and 1,113 copies of railcar 2 etc... etc.... making the query huge. it should have about 4,200 records and ends up having 4,289,154 records.
It looks like I hadn't best day today. OK, let's try again.
Create a saved query
Code:
qLastDates =
SELECT RailCarID, MAX(DateOfImport) AS [LastDate]
FROM FinalizedTraceData
GROUP BY RailCarID
Run a query
Code:
SELECT ftd.DateOFImport, ftd.RailCarID, ftd.LocationCity, ftd.State
FROM FinalizedTraceData ftd
JOIN qLastDates ld ON ld.RailCarID = ftd.RailCarID AND ld.LastDate = ftd.DateOfImport
I left half of join condition out! Btw, I think in Access is used JOIN instead of INNER JOIN (I'm too used to SQL Server syntax).