how do I run a query to select most recent date(s) from several .

G

Guest

I am trying to write a database for measurement gage calibration record
keeping. There are several gages that I must track all calibration records
for. Every 6 months each gage must be recalibrated, be each gage does not
coincide with the same calibration date. I would like a query that can group
the gages by assigned gage numbers and then select the most recent
calibration date record only. The previous records for that gage are not
needed for the report that I am trying to create.
 
K

Ken Snell [MVP]

USe a subquery to get the maximum date for each gage, and use that as the
WHERE criterion value.

SELECT GTN.GageID, GTN.GageName, GTN.CalibDate
FROM GagesTableName AS GTN
WHERE GTN.CalibDate =
(SELECT Max(G.CalibDate)
FROM GagesTableName AS G
WHERE G.GageID = GTN.GageID);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top