title: Excel > Microsoft Query > SQL Server > Multiple Parameters
body: <p>Im relatively new to sql server and excel/microsoft query,</p>
  
  <p>I have a query like this </p>
  
  <pre><code>Select ...[data]...B1.b,B2.b,B3.b From TABLEA 
  Inner join (
   SELECT ---[data]...sum(...) as b From TABLEB
   WHERE Date between [startdate] and [enddate]
  ) as B1
  Inner join (
   SELECT ---[data]...sum(...) as b From TABLEB
   WHERE Date between [startdate-1week] and [enddate]
  ) as B2
  Inner join (
   SELECT ---[data]...sum(...) as b From TABLEB
   WHERE Date between [startdate-2weeks] and [enddate]
  ) as B3
  Where Date between [startdate] and [enddate]
  </code></pre>
  
  <p>It works, when i introduce the dates manually, but i need them to be "Dynamic" (introduced from excel) but, when I put the "?" (for parameters) on all the dates, it throws an error.</p>
  
  <p>"Invalid Parameter Number"</p>
  
  <p>:D How can i make this work, within excel?</p>
  
  <p>Im using SQL Server and Microsoft Query Connection Data.</p>