Hi,
I need to calculate the average daily closing balance of an account for a week (7 Oct 2018 till 13 Oct 2018), but the account opened in the middle of the week (9 Oct 2018), so records exists in the table from date opening date, if i apply AVG function, it will calculate average for 5 days but not for 7 days. How to feed the missing days with closing balance of zero, so the average function can calculate correctly for 7 days.
Needs to be done in select query only.
Sample data below:
| Dates | closing balance |
|---|
| 09-Oct-18 | 25000 |
| 10-Oct-18 | 25000 |
| 11-Oct-18 | 25000 |
| 12-Oct-18 | 25000 |
| 13-Oct-18 | 25000 |