Hi Experts
I have a customer base table which has due date of each customer like below.
cust_id | due_dt |
1 | 4/2/2020 |
2 | 4/9/2020 |
3 | 4/17/2020 |
4 | 4/28/2020 |
18 | 4/30/2020 |
24 | 4/21/2020 |
I also have several tables which are being generated on daily basis. Like Delinquency amount table, outstanding balance table etc.
Table names are:
_yyyymmddDel_amt and _yyyymmdd_Os_Amt
e.g. for April month I have 30*2 tables.
MY desired output is as below:
How Can I achieve this dynamically, without having the need of appending all the daily tables to form a monthly table due to space and run time constraint.
cust_id | due_dt | Del_amt | Os_Amt |
1 | 4/2/2020 | Del_amt from 20200402Del_amt table | Os_amt from 20200402Del_amt table |
2 | 4/9/2020 | Del_amt from 20200409Del_amt table | Os_amt from 20200409Os_amt table |
3 | 4/17/2020 | Del_amt from 20200417Del_amt table | Os_amt from 20200417Os_amt table |
4 | 4/28/2020 | Del_amt from 20200428Del_amt table | Os_amt from 20200428Os_amt table |
18 | 4/30/2020 | Del_amt from 20200430Del_amt table | Os_amt from 20200430Os_amt table |
24 | 4/21/2020 | Del_amt from 20200421Del_amt table | Os_amt from 20200421Os_amt table |