>not sure what you mean but this seems to be working just fine
>
>execute ("Select * from #treport order by 79, " + @lcsortno)
>
>so if I am not mistaking, the # means the local temp table you're referring to
>
Yes, thanks a lot, I stand corrected.
In any case, I thought about variant order by. I believe this problem was discussed here before, but I don't recall solution at the moment.
If it's not broken, fix it until it is.
My Blog