In the future please post the code and error message from the log and paste into a code box (either the {i} or run icon) to preserve formatting. The ERROR 22-322 is usually accompanied by an underscore under the postion in code that triggered the error message. Posting into a code box will maintain the orginal formatting and allow us to see where the underscore is in the code.
Also the values of macro variable resolution help, so run the code with Options Mprint; so the log will show the code generated by the macro variable(s).
I will say it looks a tad odd to me comparing the same value, &J, to both a number of months and another count (which might need CALCULATED to resolve in the HAVE clause) .
... View more