From 7312829b3e4583a667891484c80e69d18e0a1a68 Mon Sep 17 00:00:00 2001 From: sydneynotthecity Date: Mon, 9 Dec 2024 09:36:12 -0600 Subject: [PATCH] cast string as date --- dags/queries/create_table.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dags/queries/create_table.sql b/dags/queries/create_table.sql index 8b3fee9e..12826f5e 100644 --- a/dags/queries/create_table.sql +++ b/dags/queries/create_table.sql @@ -4,6 +4,6 @@ options (partition_expiration_days = 450) as ( select * from `{project_id}.{dataset_id}.{table_id}` where - batch_run_date >= date_trunc(date_sub('{batch_run_date}', interval 15 month), day) - and batch_run_date < date_trunc('{batch_run_date}', day) + batch_run_date >= date_trunc(date_sub(date('{batch_run_date}'), interval 15 month), day) + and batch_run_date < date_trunc(date('{batch_run_date}'), day) )