• Well it doesn't look like you actually joined the temp table into the query anywhere, you're just using it in the join criteria.