or without calendar table:
declare @dtFrom date
declare @dtTo date
select @dtFrom = '2013-12-15'
,@dtTo = '2014-02-18'
select year(dt) [Year], month(dt) [Month], count(*)
from (select top(datediff(d, @dtFrom, @dtTo)) dateadd(d, row_number() over (order by (select null)), @dtFrom) dt
from sys.columns) q
group by year(dt), month(dt)
order by [Year], [Month]
Please note! sys.columns is used as a tally table, you nca use a proper one or in-line-built version if you like.
You can search for tally table examples on this forum...
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
(So many miracle inventions provided by MS to us...)
How to post your question to get the best and quick help[/url]