I have one table with two columns; UserName and SessionStartedDate. I need to add a 3rd column to this table which is called 'Was an active primay user on this date' and populate the it with YES or NO.
The data for this third column comes from a second table with two columns; UserName and 'Date of snapshot'
The slight issue I have is that the snapshot data in the 2nd table is taken on a weekly basis. So what i need to do is insert YES in the 'Was an active primay user on this date' column if the UserName matches and if the 'Date of snapshot' is in the same week as the SessionStartedDate. If there is no match, insert NO instead.
I have attached some sample data, with the two tables on separate tabs.
1. The second table ( UserName & DateOfSnapShot) having more than one DateofSnapshot value for each User? In this case you need to verify the SessionStartedDate against all the dates or take the latest DateofSnapshot for verification ?
2. Do you need check Weekstart of the SessionStartedDate against DateofSnapshot ?