Ordering Problem

Hi,

I'm having a problem with a SQL statement in a stored procedure, I am building the statement in the procedure because I want to vary the 'order by' clause. In effect I want the top ranking 5 employees to stay the same regardless of the order by. At the moment the statement is ordering the returned data and taking the top 5 out of that list rather than getting the top 5 and then ordering those results.

e.g.
select top 5 employee, post, rank, date, salary from sales where rank <> 0 and year=2002 order by salary