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.
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.