I need to display number customers with two condition:
1. who have ending balance other than 0
2. Date Stop buy: take a max voucher date of customer less than or equal to date user watch report
Ex:
Customer |
Date Stop Buy |
Ending Balance Amount |
Remaining discount |
A |
21/12/2021 |
100 |
50 |
B |
22/12/2021 |
-200 |
40 |
D |
01/01/2022 |
80 |
10 |
E |
31/12/2021 |
70 |
30 |