The @invoices table in my example, in the read world of course is a table, which I presume would be indexed adequately. The @weekendings in my solution indeed would be a table variable, Performing a tablescan is neccesary because of the nature of the query. Indexing it would not speed up anything (as far as can see anyways). The real query would be optimized on the invoice date column of the 'real' table.
Walter, true, the @invoices table would normally be a regular indexed table - what I'm referring to is any table variable that you're using in place of a CTE.