updated SQL statement from NetSpot