• You probably need to modify your dynamic sql. Without seeing how you are actually building the sql (meaning we need to know how data is being passed in the the variables) it is hard to know what suggestions to make. Looking at part of the code, I can already tell it needs work to make some of the WHERE clause SARGable.

    values I tested that worked are.....

    @year = 2013

    @month = 01

    @acct = 1

    When I do multi-select...

    @acct = 1,4

    it returns that error. Can you provide some suggestions on how to make it sargable?