title: BigQuery Command Line - How to use parameters in the query string?
body: <p>I am writing a shell script which involves BigQuery commands to query an existing table and save the results to a destination table. </p>
  
  <p>However, since my script will be run periodically, I have a parameter for the date for which the query should run. </p>
  
  <p>For example, my script looks like this:</p>
  
  <pre><code>DATE_FORMATTED=$(date +%Y%m%d)
  
  bq query --destination_table=Desttables.abc_$DATE_FORMATTED "select hits_eventInfo_eventLabel from TABLE_DATE_RANGE([mydata.table_],TIMESTAMP($DATE_FORMATTED),TIMESTAMP($DATE_FORMATTED)) where customDimensions_index = 4"
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Error in query string: Error processing job 'pro-cn:bqjob_r5437894379_1': FROM clause with table wildcards matches no table
  </code></pre>
  
  <p>How else can I pass the variable <code>$DATE_FORMATTED</code> to the <code>TABLE_DATE_RANGE</code> function from BigQuery in order to help execute my query?</p>