SELECT id from leads where date_entered &gt; DATE_ADD(CURDATE(), INTERVAL -7 DAY) 
  and date_modified NOT BETWEEN DATE_ADD(CURDATE(), INTERVAL -7 DAY) AND CURDATE()
  and deleted = 0 and status !='Converted' 