Output Most Current Date Logged in a Query (1 Viewer)

net

Registered User.
Local time
Today, 03:20
Joined
Mar 12, 2006
Messages
50
Hello Query Experts,

I have been trying to use the “Max” function to filter down to the last date logged for a particular manager and it is not working.

I would like to see the most current WO Processed Date for Carlos Garcia. He has multiple entries with various pieces of equip and they are all appearing in my output. I only need to see the most current entry (WO Processed Date) logged for Carlos.

I have attached a sample of my db for review. The query I am using is called "qry_WO_Equip"

I appreciate any help I can get. I have been working on this issue all day. :banghead: I know, I am sad. :D

I apologize, I uploaded the wrong db. I am working off of the query in this db. Thank you.
 

Attachments

  • WO_TEST_DB.accdb
    452 KB · Views: 43
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:20
Joined
Aug 30, 2003
Messages
36,123
I'm sure the need is different, but:

SELECT tbl_WO_Master.Equipment_Manager, Max(tbl_WO_Master.WO_Processed_Date) AS MaxOfWO_Processed_Date
FROM tbl_WO_Master
GROUP BY tbl_WO_Master.Equipment_Manager
HAVING (((tbl_WO_Master.Equipment_Manager)="Carlos Garcia"));
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:20
Joined
Jan 20, 2009
Messages
12,851
I'm sure the need is different, but:

SELECT tbl_WO_Master.Equipment_Manager, Max(tbl_WO_Master.WO_Processed_Date) AS MaxOfWO_Processed_Date
FROM tbl_WO_Master
GROUP BY tbl_WO_Master.Equipment_Manager
HAVING (((tbl_WO_Master.Equipment_Manager)="Carlos Garcia"));

Although It works that query groups everyone before showing the data for Carlos.

This query is more efficient because it select only the records where the manager is Carlos before it groups.

SELECT tbl_WO_Master.Equipment_Manager, Max(tbl_WO_Master.WO_Processed_Date) AS MaxOfWO_Processed_Date
FROM tbl_WO_Master
WHERE tbl_WO_Master.Equipment_Manager="Carlos Garcia"
GROUP BY tbl_WO_Master.Equipment_Manager;
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:20
Joined
Aug 30, 2003
Messages
36,123
Yeah, I was lazy because I figured the target would move anyway. Shouldn't have done that.
 

Users who are viewing this thread

Top Bottom