I\'ve got the following code below:
$db = $this->database[GDB];
$num_rows = $db->doQuery(\'SELECT TOP 100 strUserId, TotalTime, Nation, LoginDT FROM USERDA
You can change your query to this
$num_rows = $db->doQuery('SELECT TOP 100 strUserId, TotalTime, Nation, LoginDT FROM USERDATA WHERE Authority IN(1, 2) ORDER BY (TotalTime + ('.time().' + 7200 - LoginDT)) DESC');
Please note that the query is concatenated with time() since it's a PHP function, not a SQL Server function.
This is the generated query
SELECT TOP 100 strUserId, TotalTime, Nation, LoginDT FROM USERDATA WHERE Authority IN(1, 2) ORDER BY (TotalTime + (1416132847 + 7200 - LoginDT)) DESC
Demo: http://codepad.org/vSR2FJ8C