title: Passing values to variables in SQL server from Access
body: <p>I have a large query in SQL Server that returns many rows and columns. I need to create a user interface in MS Access for that query. In order to run the query I need to pass some variables to the query. For example:</p>
  
  <p>DECLARE @start_date date, @end_date date
  SELECT *
  FROM myTable
  WHERE Date BETWEEN @start_date AND @end_date</p>
  
  <p>I know that I can't have a DECLARE statement in the ACCESS query viewer. But is there another way of passing these parameters to the query?
  I've read that it can be done with VBA, but I just want to confirm that there is no other way of passing values to the variable. </p>
  
  <p>Ideally, what I will need is to interact with SQL Server via MS ACCESS</p>
  
  <p>Thanks</p>