title: Build dynamic query(dynamic operator) in SSRS using a complex query
body: <p>I would like to build a dynamic query for a specific report using some parameters (dynamic operators).</p>
  
  <p>How can I add dynamic parameters without writing/editing the expression?</p>
  
  <p>Because my query is complex, included three-join tables and aggregations I think this might be cause the error.</p>
  
  <p>Can I join tables within an expression in dataset properties? </p>
  
  <pre><code>SELECT  a.CaseNo, a.PatientName, a.PolicyNumber, 
  </code></pre>
  
  <p><code>FROM Cases a</code></p>
  
  <p><code>INNER JOIN GOPs b
   ON a.CaseNo = b.CaseNo</code></p>
  
  <pre><code>INNER JOIN Invoices d ON d.CaseNo = a.CaseNo 
  
  WHERE (a.CreatedDate &gt;= @StartDate AND a.CreatedDate &lt;= @EndDate +1)
  </code></pre>
  
  <p>This query is working properly if I write it directly in query editor. However, when I put it as an expression does not work anymore.</p>
  
  <p>Also, I would like to add dynamic operators to that query. The only solution is to put it as an expression. E.g. at the end of the query I want to add the following:</p>
  
  <pre><code>AND FeeEuro "+ Parameters!Operator.Value + Parameters!OperatorValue.Value
  </code></pre>
  
  <p>something like that</p>
  
  <pre><code>AND FeeEuro &gt; 200
  </code></pre>
  
  <p>Is it possible to do what I need to do, if so can you point me in the right direction?</p>