Sort Table With only the latest date

G

Greg72

using access 2007...
I have a table that I'm trying to create a query on.

I have three main fields I want to use PN,status,status_date all in a
table named Status.

What I want to be able to do is say I have a PN 0004 and on 1/7/08 I
have a status of good
and 1/8/08 I have a status of bad. I want the query only to return the
latest status date.
If I use a Total Max function it seems to and order the status by max
date so I would still see PN 0004 with the latest date first but still
see the older dates.
I created a query like below:
SELECT Status.[PN], Status.[Status], Max(Status.[status_date]) AS
MaxOfstatus_date
FROM Status
GROUP BY Status.[PN], Status.[Status];

but that doesn't seem to work. Any help would be greatly appreciated.
 

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

Similar Threads

Using Max 2
Running Total 10
a status like "checking" to change to date format when completed 4
Final Status 1
Query Criteria 1
<= doesn't work? 5
iif exists - too complex? 0
Update field in table 5

Top