I have a list of departments with a list of addresses. Each address has a period with a from date. The following code finds the address within each department with the lates