SSRS SQL Query to show the zero value for non existing recordsReport
I am using the following query to pull the data for last 11/12 months
SELECT [ID] ,[Name] ,[Amount] FROM DB1 WHERE [Period] BETWEEN @FromMonth AND @ToMonth AND [Desc] = 'XYZ'
What I want to achieve is, some IDs does not have a any record for some periods(month) with no amount. Currently the query doesn’t return anything for those combination of names and months where there is no record in DB. It only displays a result if the ID has a certain amount and date in db. However, what I want is that if an ID doesn’t have an amount for a month then it should show the amount for that month.
@ToMonth are the parameters being passed to the report. I know I can achieve this by pivoting but I don’t want to do that. Any hints?
solved 04 months 1 Answer 27 views 0