c174:resulting where: AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') AND ((YEAR(wp_posts.post_date)=2014 AND MONTH(wp_posts.post_date)=07 AND DAYOFMONTH(wp_posts.post_date)=31) OR ((YEAR(start)=2014 AND MONTH(start)=07 AND DAYOFMONTH(start)=31) OR (start<='2014-07-31 0:0:0' AND end>='2014-07-31 0:0:0')))