I have an existing query which uses TABLE_QUERY(), and filters the results based on creation_time:
SELECT
*
FROM (TABLE_QUERY( project_114151_dataset , "MSEC_TO_TIMESTAMP(creation_time) > DATE_ADD(CURRENT_TIMESTAMP(), -45, 'DAY') AND REGEXP_MATCH(table_id, r'^fact_[0-9]{8}$') "))
I want to change the query to run based on last_modified_time; since it is also a timestamp in msec, I changed the query to be as follows
SELECT
*
FROM (TABLE_QUERY( project_114151_dataset , "MSEC_TO_TIMESTAMP(last_modified_time) > DATE_ADD(CURRENT_TIMESTAMP(), -45, 'DAY') AND REGEXP_MATCH(table_id, r'^fact_[0-9]{8}$') "))
However, when running I am getting the following error:
Error: Error evaluating subsidiary query
Not sure why I'm getting this error; I've verified that this field exists by running the following query, and it does indeed return in the results:
SELECT * FROM project_114151_dataset.__TABLES__
WHERE MSEC_TO_TIMESTAMP(creation_time) <
DATE_ADD(CURRENT_TIMESTAMP(), -7, 'DAY')
Any help would be appreciated!