you could use an if statement,
Code:
if @Gender == 'both'
query = SELECT tblUserData.* FROM tblUserData ORDER BY rank DESC
else
query = SELECT tblUserData.* FROM tblUserData WHERE sex = @Gender ORDER BY rank DESC
or something along those lines, depends what code (
PHP,
ASP etc) you are using on your site as to exactly how you code it into the page.
would that work for what you want to do?