Mel,
That's exactly the point. You use 'IF' outside a query and macro substitution is evaluated only once, not for every row.
>
>>The best way in this case would be to use macro substitution. This way JOIN will be optimizable with proper indexes. <
>
>The if/endif statement can't be within a Select statement can it (as each row has to be evaluated)?
>
--sb--