Hello all,
(i'm learning alot with this forum!!! Thank you all!!!)
I need your help, because i'm banging with my head on the wall...
I Have a table, with accounts, and ID that were created on a data. The same account may have different activations, wich one with a different id, with a new creation date:
TABLE 1
Afer a new contact, i need to get the nearest high date after contact (new activation), after the date contact, with the id associated to it (the last two columns, are the expected date and expecte result id).
TABLE 2
I appreciate your help! Thank you
TS
(i'm learning alot with this forum!!! Thank you all!!!)
I need your help, because i'm banging with my head on the wall...
I Have a table, with accounts, and ID that were created on a data. The same account may have different activations, wich one with a different id, with a new creation date:
TABLE 1
A | B | C | D |
ACCOUNT | ID | Creation Date | Amount Id's |
7000004 | 70000040026 | 30/05/2014 | 1 |
7000005 | 58912 | 08/04/2020 | 2 |
7000005 | 28119 | 02/08/2017 | 2 |
7000007 | 70000070096 | 30/05/2014 | 1 |
7000008 | 70000080087 | 01/02/2019 | 1 |
7000060 | 70000600007 | 28/08/2019 | 1 |
7000064 | 70000640068 | 02/01/2020 | 1 |
7000066 | 14622 | 11/02/2016 | 2 |
7000066 | 70000660050 | 30/05/2020 | 2 |
7000067 | 70000670041 | 30/05/2014 | 1 |
7000070 | 2048 | 13/08/2014 | 3 |
7000070 | 70000700014 | 30/05/2014 | 3 |
7000070 | 70000730084 | 01/04/2020 | 3 |
7000080 | 70000800021 | 30/05/2014 | 1 |
Afer a new contact, i need to get the nearest high date after contact (new activation), after the date contact, with the id associated to it (the last two columns, are the expected date and expecte result id).
TABLE 2
Contact - ACCOUNT | Date_Contact | Expected Result Date | Expected Result ID |
7000004 | 12/02/2020 | blank | blank |
7000005 | 01/12/2019 | 08/04/2020 | 58912 |
7000005 | 13/03/2020 | 08/04/2020 | 58912 |
7000007 | 01/08/2019 | blank | blank |
7000008 | 15/01/2019 | 01/02/2019 | 70000080087 |
7000060 | 01/07/2019 | 28/08/2019 | 70000600007 |
7000066 | 14/02/2019 | blank | blank |
7000066 | 01/08/2020 | blank | blank |
7000067 | 01/12/2013 | 30/05/2014 | 70000670041 |
7000070 | 28/04/2014 | 30/05/2014 | 70000700014 |
7000070 | 01/01/2020 | 01/04/2020 | 70000730084 |
7000070 | 01/01/2012 | 30/05/2014 | 70000700014 |
7000070 | 01/07/2014 | 13/08/2014 | 2048 |
I appreciate your help! Thank you
TS