>That actually is syntactically incorrect, but what I'm doing now is extracting into a lookup table as table variable first and then JOINing to that instead of the function.
>
>I'm using the 'primary key' qualifier within the table definition to avoid the table scan problem and the performance is not too bad.
>
>Thanks for your assistance which pushed me into thinking of alternatives.
Hi Simon,
Sometimes a temp table may be faster because you can create an index on it. You can also create an index on a table variable with primary key constraint.
--sb--