I have a table of the below format:
ID ChildCode ParentCode Action ActionDate
1 1 1 Added 8/9/16 14:01
1 2 1 Added 8/9/16 14:01
1 1 1 Removed 2/27/17 9:21
1 1 1 Added 2/15/19 10:27
1 3 2 Added 2/15/19 10:27
1 4 2 Added 2/15/19 10:27
1 5 2 Added 2/15/19 10:27
I am looking for what parent code was added in Feb 2019 for the first time. In this case the result set will have data only for parentcode 2 and childcode 3,4,5.
Child 1 and ParentCode 1 was also added on 2/15 but it should not be in the result set because parentcode 1 with a child code of 2 was already added on 8/19 .
ID ChildCode ParentCode Action ActionDate
1 1 1 Added 8/9/16 14:01
1 2 1 Added 8/9/16 14:01
1 1 1 Removed 2/27/17 9:21
1 1 1 Added 2/15/19 10:27
1 3 2 Added 2/15/19 10:27
1 4 2 Added 2/15/19 10:27
1 5 2 Added 2/15/19 10:27
I am looking for what parent code was added in Feb 2019 for the first time. In this case the result set will have data only for parentcode 2 and childcode 3,4,5.
Child 1 and ParentCode 1 was also added on 2/15 but it should not be in the result set because parentcode 1 with a child code of 2 was already added on 8/19 .