F
F.
Hi,
I'm struggling with a query that I'm sure should be easy: I have a table
"assignements" that has fields
- assignmentID (autonumber)
- personID (long)
- assignmentEndDate (date)
- and more.
I want my query to give a list of (personID , assignmentID) with the
assignmentID of the latest assignment of each person. Each person should be
listed only once, of course. I tried GROUP BYs or TOP 1s to no avail
FYI, this query (let's call it "lastAssignmentOfPerson") is to be used in
another query with
.... LEFT JOIN lastAssignmentOfPerson ON [assignements].personID =
lastAssignmentOfPerson.personID
that is, I want to know, when I'm assigning a person to a new job, what was
his last assignment.
Thanks for the help,
I'm struggling with a query that I'm sure should be easy: I have a table
"assignements" that has fields
- assignmentID (autonumber)
- personID (long)
- assignmentEndDate (date)
- and more.
I want my query to give a list of (personID , assignmentID) with the
assignmentID of the latest assignment of each person. Each person should be
listed only once, of course. I tried GROUP BYs or TOP 1s to no avail
FYI, this query (let's call it "lastAssignmentOfPerson") is to be used in
another query with
.... LEFT JOIN lastAssignmentOfPerson ON [assignements].personID =
lastAssignmentOfPerson.personID
that is, I want to know, when I'm assigning a person to a new job, what was
his last assignment.
Thanks for the help,