title: SQL Command: Repeating input in command
body: <p>I have an Excel worksheet with several queries, where I enter a date format several times per query. When I produce the data for May I input '2021-05-31' several times, and when I want to produce data for June the date input must be changed for all of them.</p>
  <p>Here's an example, where I extract customer transactions with transaction date up until 31.05.2021, that is not posted in a table with settled transactions up until 31.05.2021. Here I must change the date input twice:</p>
  <pre><code>SELECT * 
  FROM CustTrans 
  WHERE TransDate =&lt; '2021-05-31' 
    AND VOUCHER NOT IN (SELECT VOUCHER 
                        FROM CustSettlement 
                        WHERE TransDate =&lt; '2021-05-31') 
  </code></pre>
  <p>Is it possible to define a reference like 'Date' = '2021-05-31' and then repeat Transdate =&lt; 'Date'?</p>
  <p>And is it possible to reference a cell from the Excel workbook for queries?</p>
  <p>I write/submit sql to the database through the following path:
  Data -&gt; Queries &amp; Connections -&gt; Properties -&gt; Connection Properies -&gt; Definition -&gt; Command text</p>