Fixed missing AND in SQL statement