• It is indeed an inline statement that contains 3 CTEs and a final query referencing the CTEs. As I mentioned, when I pull the code out to a separate query, defining and setting the variables that were the parameters, it works great.