Error in sql statement to retrieve bot stats. Fixed it