select dateadd(month, datediff(month, 0, [Date]), 0), sum(Quantity)
from yourtable
where IsSold = 1
group by dateadd(month, datediff(month, 0, [Date]), 0)
select dateadd(month,datediff(month,0,[Date]),0) as [Month]
,sum(Quantity*sign(IsSold)) as Sold
,sum(Quantity*abs(sign(IsSold)-1)) as NotSold
from yourtable
group by dateadd(month,datediff(month,0,[Date]),0)
;
Option 2:
select dateadd(month,datediff(month,0,[Date]),0) as [Month]
,sum(case when IsSold=0 then 0 else Quantity end) as Sold
,sum(case when IsSold=0 then Quantity else 0 end) as NotSold
from yourtable
group by dateadd(month,datediff(month,0,[Date]),0)
;