I want the selected data in below format.
TOTAL_FEE WEEK
+---------------+--------------+
24000 WEEK_1
24000 WEEK_2
24000 WEEK_3
My query that give me result groupby date is :
select count(*) * 24000, CAST(p.submited_date AS DATE)
from Form_For_Business_Name_Registration p
where p.STATUS !='NS'
and CAST(p.submited_date AS DATE)>='2016-01-22'
and CAST(p.submited_date AS DATE)<='2016-03-04'
GROUP BY CAST(p.submited_date AS DATE)
What i want is to get results groupby weeks but weeks should be calculated from the given date range.
Note : if there is no data for the week it should return 0 counts for that week.
Will somebody guide me to write a SQL query to get desired output.
Thank you!