• So this was a simplified example?

    If you're having trouble implementing a more complex solution, post the table info and the expected result.