title: I have written a query (SQL) in R to get some data from a database. I'd like to pass the date assigned by a subroutine in R instead of hard coding it
body: <pre><code>DATA=dbGetQuery(conn, "SELECT 
                    A, 
                    B as 'Ba',
                    C  as 'Ca',  
                    D as 'Da',
                    date as 'Date'
                    from database where date&gt;='2000-01-01' and date&lt;='2001-01-01' ")
  </code></pre>
  
  <p>I'd like to replace the '2000-01-01' and '2001-01-01' by "date1 and date2", both provided in a function or subroutine. </p>