In our tables, we have sequences for jobs. Each separate operation has a sequence number, status of the operation (open, started or closed) and an update date/time. I would like to use this information to create a current operation for tracking purposes. So here is how I think it should work.
look at job # 123456 and then sorted by last time entry from another table. It then looks at the operation for that and follows the following logic. If the status of that operation is closed, then move to next sequence (unless of course it is the final op) and that is the correct location/operation.
If that is not possible then we could simply sort by sequence and look for the first sequence that is either started or open.