title: how to use date_add,Date_sub in bigquery
body: <p>Query error: Cannot coerce expression (select DATE_ADD(C.DOB, interval 25 year) from statfinity-1.statfinity_sql_case_1.Customer C) to type STRING at [2:37]</p>
  <pre><code>declare greater_date string default (select DATE_ADD(C.DOB, interval 25 year) from statfinity-1.statfinity_sql_case_1.Customer C);
  declare lower_date string default (select DATE_ADD(C.DOB, interval 35 year) from statfinity-1.statfinity_sql_case_1.Customer C);
  
  SELECT SUM(A.total_amt) as net_total_revenue
  from statfinity-1.statfinity_sql_case_1.Transaction A 
  inner join statfinity-1.statfinity_sql_case_1.Customer C 
  ON A.cust_id = C.customer_Id
  where A.tran_date &gt;= DATE_sub((max_date), interval 30 Day) AND 
  (Select cast(A.tran_date as Date)) &gt;= greater_date AND 
  (Select cast(A.tran_date as Date)) &lt;= lower_date;
  </code></pre>