title: SQL query variables in MS Access
body: <p>When writing a query for SQL Server, you can declare and use variables like this:</p>
  
  <pre><code>declare @test int
  select @test = max(ID) from MyTable1
  update MyTable2 set (...) where ID &gt; @test
  update MyTable3 set (...) where ID &lt; @test
  </code></pre>
  
  <p>Is there a way to declare and use variables similarly when writing a query for MS Access?</p>
  
  <p>I need to populate the variable with the result of another query and then use that value to perform insert/update operations. The query will be run from a .NET app.</p>