>>My cte only uses the original where - it does not restrict records based on the distance. I do need the final where clause.
>
>
>I give up
One of us have some misunderstanding - I suppose it's you in this case.
If it's not broken, fix it until it is.
My Blog