Query9 failed:(SELECT * FROM ads, ad_groups WHERE ad_groups.group_client = 'PIG' AND ad_groups.group_id = ads.ad_group_id AND ad_groups.group_id = HAVING ('2018-08-17' BETWEEN ads.ad_startDate AND ads.ad_endDate) ) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'HAVING ('2018-08-17' BETWEEN ads.ad_startDate AND ads.ad_endDate)' at line 7