When i try to run this query, i can't seem to divide the sum of two grouped data together. It keeps coming up as 0.00. It's ok to add or subtract but not divide. Any help will be appreciated.
sum(a.totalCalls) as total_calls,
sum(a.callsanswered) as answered,
Cast((sum(a.callsanswered)/sum(a.totalCalls)) as decimal(12,2))
dbo.FactAggCalls a, dbo.DimTime b
a.TimeID = b.TimeID
datepart(month,b.TimeActualDate) = '6'