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 'AND status='ACTIVE' AND JSON_UNQUOTE(JSON_EXTRACT(json_data,'$.date'))<'2025-08-' at line 3