Query to Pull Latest Record

C

Chip

I am trying to build a report from an "Inspection Checklist" table that
contains the annual checklists from each Facility. There can be multiple
Inspection records for each facility but i want to only view the latest
Inspection Record from each facility. I can do this with latest Inspection
Date or I can use the largest Inspection ID# (this is the Primary Key of the
table which is an 'Autonumber' field that increases for each Inspection
inputted.) Is there any way to pull this type of query in ACCESS??

I am just learning ACCESS and can barely spell 'VB' so please be gentle with
your answers...

And as always THANKS IN ADVANCE!!!!
 
M

Marshall Barton

Chip said:
I am trying to build a report from an "Inspection Checklist" table that
contains the annual checklists from each Facility. There can be multiple
Inspection records for each facility but i want to only view the latest
Inspection Record from each facility. I can do this with latest Inspection
Date or I can use the largest Inspection ID# (this is the Primary Key of the
table which is an 'Autonumber' field that increases for each Inspection
inputted.) Is there any way to pull this type of query in ACCESS??


That requires nested querys along the lines of this air
code:

SELECT *
FROM [Inspection Checklist] As T
WHERE [Inspection Date] =
(SELECT Max(M.[Inspection Date])
FROM [Inspection Checklist] As M
WHERE M.Facility = T.Facility)
 

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