neilmcdonald
Technical User
- Aug 16, 2002
- 53
Hi,
I have two tables, Job and Event. A Job has several events and the tables are linked by jobid. Each Event also has a status.
I need to find the status of the last event for each job.
I've gotten as far as finding the last event for each job by doing the following:
But I do not know how to also get the status.
I'd be grateful if somebody could point me in the right direction!
Thanks,
Neil
I have two tables, Job and Event. A Job has several events and the tables are linked by jobid. Each Event also has a status.
I need to find the status of the last event for each job.
I've gotten as far as finding the last event for each job by doing the following:
Code:
SELECT A.MaxDateTime, Job.JobID
FROM (SELECT JobID, MAX(EvDateTime) AS MaxDateTime
FROM Event
GROUP BY JobID) AS A INNER JOIN
Job ON A.JobID = Job.JobID
But I do not know how to also get the status.
I'd be grateful if somebody could point me in the right direction!
Thanks,
Neil