I need help on a query to extract all rows between the period - 01/04/2021 and 31/03/2022 based on last_modified_date column.
However, the problem is I need to include all rows where balances are above 0 but the last_modified_date is out of the above range. This is because the balance has remained unchanged in the period between 01/04/2021 and 31/03/2022.
For example -
The latest last_modified_date for an ID is 01/01/2020 (max date but falls outside the above range - 01/04/2021-31/03/2022) and the balance is 100. This means the current balance stayed at 100 even in the date range - 01/04/2021 - 31/03/2022 as this balance remain unchanged from 01/01/2020. So as per the logic this row of data should be included even if it is outside of the range.
Can somebody please help with this issue ?