diff --git a/posthog/queries/funnels/funnel_event_query.py b/posthog/queries/funnels/funnel_event_query.py index cb5cf53fc7544..9d750eb604652 100644 --- a/posthog/queries/funnels/funnel_event_query.py +++ b/posthog/queries/funnels/funnel_event_query.py @@ -111,7 +111,7 @@ def get_query( SELECT {all_fields} FROM events {self.EVENT_TABLE_ALIAS} {sample_clause} - {self._get_person_ids_query(relevant_events_conditions=entity_query + date_query)} + {self._get_person_ids_query(relevant_events_conditions=f"{entity_query} {date_query}")} {person_query} {groups_query} {{extra_join}} diff --git a/posthog/queries/paths/paths_event_query.py b/posthog/queries/paths/paths_event_query.py index a09159aadc2c1..134b61f5be66a 100644 --- a/posthog/queries/paths/paths_event_query.py +++ b/posthog/queries/paths/paths_event_query.py @@ -126,7 +126,7 @@ def get_query(self) -> Tuple[str, Dict[str, Any]]: query = f""" SELECT {','.join(_fields)} FROM events {self.EVENT_TABLE_ALIAS} {sample_clause} - {self._get_person_ids_query(relevant_events_conditions=self._get_event_query(deep_filtering=True)[0] + date_query)} + {self._get_person_ids_query(relevant_events_conditions=f"{self._get_event_query(deep_filtering=True)[0]} {date_query}")} {person_query} {groups_query} {funnel_paths_join} diff --git a/posthog/queries/stickiness/stickiness_event_query.py b/posthog/queries/stickiness/stickiness_event_query.py index d4ab7c6d0bef3..7fbcd7d5a2a8a 100644 --- a/posthog/queries/stickiness/stickiness_event_query.py +++ b/posthog/queries/stickiness/stickiness_event_query.py @@ -57,7 +57,7 @@ def get_query(self) -> Tuple[str, Dict[str, Any]]: ) as num_intervals FROM events {self.EVENT_TABLE_ALIAS} {sample_clause} - {self._get_person_ids_query(relevant_events_conditions=entity_query + date_query)} + {self._get_person_ids_query(relevant_events_conditions=f"{entity_query} {date_query}")} {person_query} {groups_query} WHERE team_id = %(team_id)s diff --git a/posthog/queries/trends/trends_event_query_base.py b/posthog/queries/trends/trends_event_query_base.py index 3e274b0c59f53..16f742febc52b 100644 --- a/posthog/queries/trends/trends_event_query_base.py +++ b/posthog/queries/trends/trends_event_query_base.py @@ -66,7 +66,7 @@ def get_query_base(self) -> Tuple[str, Dict[str, Any]]: query = f""" FROM events {self.EVENT_TABLE_ALIAS} {sample_clause} - {self._get_person_ids_query(relevant_events_conditions=deep_entity_query + date_query)} + {self._get_person_ids_query(relevant_events_conditions=f"{deep_entity_query} {date_query}")} {person_query} {groups_query} {session_query}