From the below.
worksheet1 : In worksheet1 "duty" column. I need to find out what duty "worker" last had during work_order_date. Bill on work_order_date 08/01/2017 & 08/05/2017 should report back as "welder" because he was not yet a manager until 8/15/2017. worksheet1 Bill work_order_date 09/20/2017 "duty" column should be "manager" because he was last reported as manager in worksheet2 on 8/15. he was not yet an owner until 10/20.
[TABLE="width: 500"]
<tbody>[TR]
[TD]worksheet1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]worksheet2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]worker[/TD]
[TD]work_order_date[/TD]
[TD]duty[/TD]
[TD][/TD]
[TD]worker[/TD]
[TD]employment_date[/TD]
[TD]duty[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]08/01/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]07/30/2017[/TD]
[TD]welder[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]08/05/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]08/15/2017[/TD]
[TD]manager[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]09/20/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]10/20/2017[/TD]
[TD]owner[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]jan[/TD]
[TD]10/31/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]jan[/TD]
[TD]11/05/2017[/TD]
[TD]client[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
worksheet1 : In worksheet1 "duty" column. I need to find out what duty "worker" last had during work_order_date. Bill on work_order_date 08/01/2017 & 08/05/2017 should report back as "welder" because he was not yet a manager until 8/15/2017. worksheet1 Bill work_order_date 09/20/2017 "duty" column should be "manager" because he was last reported as manager in worksheet2 on 8/15. he was not yet an owner until 10/20.
[TABLE="width: 500"]
<tbody>[TR]
[TD]worksheet1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]worksheet2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]worker[/TD]
[TD]work_order_date[/TD]
[TD]duty[/TD]
[TD][/TD]
[TD]worker[/TD]
[TD]employment_date[/TD]
[TD]duty[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]08/01/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]07/30/2017[/TD]
[TD]welder[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]08/05/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]08/15/2017[/TD]
[TD]manager[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bill[/TD]
[TD]09/20/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]bill[/TD]
[TD]10/20/2017[/TD]
[TD]owner[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]jan[/TD]
[TD]10/31/2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]jan[/TD]
[TD]11/05/2017[/TD]
[TD]client[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]