G
Guest
This seems simple enough but I just can't figure it out.
I have three tables, Repairs, Parts, and Items. The Repairs table contains
a Repair ID (PK) for each repair and an Equipment ID (FK), and Date of
repair. Many repairs can be done to the same piece of equipment. The Parts
table contains the parts used in the repair, Parts ID (PK), Item ID (FK),
Repair ID (FK). The Items table contains Item ID (PK), Item Type.
What I want is the Equipment ID, Repair ID, and Item ID for the latest Date
of Repair for each Equipment ID. I have a query that gives me the Equipment
ID, Repair ID, Date of Repair, and Item ID for a specific Item Type but, I
can’t get the group by/max/last/first to give me just the latest one per
piece of equipment…
Thank you in advance,
Jim
I have three tables, Repairs, Parts, and Items. The Repairs table contains
a Repair ID (PK) for each repair and an Equipment ID (FK), and Date of
repair. Many repairs can be done to the same piece of equipment. The Parts
table contains the parts used in the repair, Parts ID (PK), Item ID (FK),
Repair ID (FK). The Items table contains Item ID (PK), Item Type.
What I want is the Equipment ID, Repair ID, and Item ID for the latest Date
of Repair for each Equipment ID. I have a query that gives me the Equipment
ID, Repair ID, Date of Repair, and Item ID for a specific Item Type but, I
can’t get the group by/max/last/first to give me just the latest one per
piece of equipment…
Thank you in advance,
Jim