the following query is displaying the result i want except i want it to show 0 for each month with non production.
SELECT DATENAME(MONTH, DATEADD(M, MONTH(PolicyDetails.IssuedDate), - 1)) AS Month, SUM(PolicyDetails.Premium) AS TotalProduction, DATENAME(YEAR, PolicyDetails.IssuedDate) AS Year FROM PolicyDetails INNER JOIN Clients ON PolicyDetails.ClientId = Clients.ClientId WHERE (Clients.Username = @Username) GROUP BY MONTH(PolicyDetails.IssuedDate), DATENAME(YEAR, PolicyDetails.IssuedDate)
Month || Total Production -$$
2019 - August || 45.00
2019 - October || 45.00
in this table i want to show "2019 - September" with Total Production = 0 instead of displaying nothing. How ??