 	  else
 	  set rowcount	1 
 
-      select @firstselectuserid = a.UserID ,  
+      select @firstselectuserid = a.[Name] ,  
 	         @firstselectlastvisit = a.LastVisit, 
 			 @firstselectjoined = a.Joined, 
 			 @firstselectrankid = a.RankID, 

			TotalCount =  @user_totalrowsnumber 
			from [{databaseOwner}].[{objectQualifier}User] a with(nolock)
			join [{databaseOwner}].[{objectQualifier}Rank] b with(nolock) on b.RankID=a.RankID	
      where (a.UserID >= (case 
        when @SortName = 1 then @firstselectuserid end) OR a.UserID <= (case 
        when @SortName = 2 then @firstselectuserid end) OR
		a.UserID >= (case 
        when @SortName = 0 then 0 end)) and
		(a.Joined >= (case 
        when @SortJoined = 1 then @firstselectjoined end) 
		OR a.Joined <= (case 

		where
			a.BoardID=@BoardID
		order by
			a.SortOrder,
			a.Name
	else
		select
