• pietlinden - Friday, February 9, 2018 9:17 AM

    Thom A - Friday, February 9, 2018 9:00 AM

    "it didn't work for me"? What do you mean? Did you get an error, unexpected results? You didn't like what you saw?

    Rather than using a SQL query to PIVOT your data and using that data as your dataset in SSRS, consider doing the pivoting in SSRS using a Matrix.

    Without the IN() clause in the pivot, how do you force the existence of columns in the pivot? Use an outer join to a Tally table? Otherwise, if there are no results for a month, then the column will drop out of the pivot instead of showing zeroes.

    Yes, you'll need something to determine your groupings if there are no results, certainly. Using a Tally table, or Calendar Table (considering the OP's Pivot is on Month), would certainly solve that issue.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk