• I'm not sure why the sub-selects are being generated, but removing them doesn't make a difference. It's almost as if the query is trying to use the filtered index when we specify an inner join, but not for a left join, and using this index for the query results in the error.

    The reason I say this is that the inner join works if we create a more appropriate index, which is then used instead. Here is the new index I created:

    CREATE NONCLUSTERED INDEX test

    ON [Reporting].[fctSwapDualShift] ([ValuationDateID])

    INCLUDE ([BookID],[TransactionID],[ParallelShiftID],[SwapTenorID],[Value])

    Any ideas why this is happening?