$post_this_month = $wpdb->get_results($wpdb->prepare("
SELECT
key1.ID,
key1.post_title,
days.meta_value as days
FROM
$wpdb->posts key1
INNER JOIN $wpdb->postmeta days ON days.post_id = key1.ID
AND days.meta_key = %s
INNER JOIN $wpdb->postmeta startdate ON startdate.post_id = key1.ID
AND startdate.meta_key = %s
INNER JOIN $wpdb->postmeta enddate ON enddate.post_id = key1.ID
AND enddate.meta_key = %s
WHERE days.meta_key = %s
AND startdate.meta_value <= %s
AND enddate.meta_value >= %s
AND key1.post_type = %s
", \'_days\', \'_start_date\', \'_end_date\',
\'_days\', $month_end, $month_start, \'mbe_enrollments\'
));