The below table holds transaction details.
| Txn_date | Txn_Amount |
|---|
| 6/1/2019 | 1000 |
| 6/2/2019 | 2000 |
| 6/5/2019 | 3000 |
| 6/8/2019 | 5000 |
| 6/10/2019 | 1000 |
I have another table and its holds Date range (Entire June month 6/1 to 6/30).
| Date |
|---|
| 6/1/2019 |
| 6/2/2019 |
| 6/3/2019 |
| 6/4/2019 |
| 6/5/2019 |
| 6/6/2019 |
| 6/7/2019 |
| 6/8/2019 |
| 6/9/2019 ..... |
| .......6/30/2019 |
Here my requirement is, i need to join these 2 tables and if the transaction date is matching then i display current row txn_amount, if transaction is not happen on particular date then i need to display previous date transaction amount.
Required output:
| Date | Txn_amount |
|---|
| 6/1/2019 | 1000 |
| 6/2/2019 | 2000 |
| 6/3/2019 | 2000 (transaction is not happens on 3rd june, so i display previous txn date amount) |
| 6/4/2019 | 2000 (transaction is not happens on 4th june, so i display previous txn date amount) |
| 6/5/2019 | 3000 |
| 6/6/2019 | 3000 (transaction is not happens on 6th june, so i display previous txn date amount) |
| 6/7/2019 | 3000(transaction is not happens on 7th june, so i display previous txn date amount) |
| 6/8/2019 | 5000 |
| 6/9/2019 | 5000 (transaction is not happens on 9th june, so i display previous txn date amount) |
| 6/10/2019........ | 1000 |
| .........6/30/2019 | 1000 (after 10th june there is no transaction happens, so all remaining days display last txn amount |