I have a table with date, account, Active_flag (Yes/No) fields. I want to see how many Total number of accounts are active by the end of every week for a particular month. So here for a week 03.04.2012 i can have 250 active accounts, for 03.11.2012 i can have 300 active accounts, 03.18.2012 i can have 200 active accounts(which is less compared to previous week)
Output i want:
Can we see the exact query?
I believe you would get an error would this sql because you need a to_char around(DATE, 'IW');
select Count(account), (DATE, 'IW') + 6 from table where Active_flag ='Y' group by (DATE, 'IW') + 6
Also some example data..