red-oxygen-69265
01/21/2022, 6:16 AMfresh-football-47124
red-oxygen-69265
01/21/2022, 2:12 PMfresh-football-47124
red-oxygen-69265
01/21/2022, 11:32 PM__users as (
-- Users visiting specific pages
SELECT
p.user_id as user_id,
MIN(p.timestamp) as actual_start,
DATETIME_ADD(MIN(p.timestamp), INTERVAL 3 DAY) as conversion_end,
DATETIME_SUB(MIN(p.timestamp), INTERVAL 30 MINUTE) as session_start
FROM
__pageviews p
WHERE
p.timestamp >= DATETIME "2021-10-23 00:00:00"
AND p.timestamp <= DATETIME "2022-01-21 00:00:00"
GROUP BY
p.user_id
but get this error. I believe bigquery doesn’t support MINUTE on DATETIME_SUB?
DATETIME_SUB does not support the MINUTE date part at [18:5]
p.timestamp >= DATETIME "2021-10-23 00:00:00"
requires timestamp to be of type DATE/DATETIME
but
DATETIME_SUB(m.timestamp, INTERVAL 30 MINUTE)
does not work on the above types and only works on timestamp types