SELECT payment_details.*,member.member_name,member.email FROM payment_details JOIN member ON member.id = payment_details.user_id WHERE DATE(payment_details.created_at) <= SUBDATE(CURRENT_DATE(),1) AND DATE(payment_details.created_at) >= SUBDATE(CURRENT_DATE(),INTERVAL 1 WEEK);