The table I'm using has columns for Revenue\_Start\_Date, Total\_Revenue and Days and I need to group the revenue by month. The daily revenue amount is obvious (Total\_Revenue/Days) but I don't know how to group the revenue monthly. 

For example, if a line item has a start date of 8/25/14 and $5,000 revenue for 50 days, then the daily revenue is $100. August total would be $600, September would be $3,000 and October would be $1,400. 

I'm wondering if I should create a function that inserts $100 into a temp table for each day and then query the table and do a group by. Is there a way without using a cursor to do the insert?