Here's the statement. There is a nested SQL statement in the order by:
SELECT (strLName + ', ' + strFName) as name
FROM UserInfo, LoginInfo
WHERE UserInfo.strUserID = LoginInfo.strUserID
AND strRights = 'user'
AND (strUserStatus = 'active'
OR strUserStatus = 'inactive')
ORDER BY (SELECT strLName + ', ' + strFName
FROM UserInfo
WHERE strAdminID = UserInfo.strUserID) ASC,
strLName, strFName, strUserStatus
What essentially we want to happen is just change the order by clause around depending on how the user clicks to sort the data. Does this make sense??
Thanks for all the helP!