title: Where to Execute? SSRS OR SQL
body: <p>When I'm creating an SSRS report, I always have a dilemma about "how to create the report with the least generation time possible".</p>
  
  <p>In general the generation time (or performance time) is divided into two main parts:</p>
  
  <ol>
  <li>The SQL Query.</li>
  <li>The Report components (expressions, groups etc.).</li>
  </ol>
  
  <p>As you know some of the things that are being performed in SSRS can be done in the SQL query and vice versa.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>I can use <code>Group by</code> clause in SQL, but can do the same when using a Table with Groups definition.</li>
  <li>I can use <code>Casting</code> in order to compare two values in SQL and also directly inside an expression.</li>
  </ul>
  
  <p>and many more...</p>
  
  <p>My questions are:</p>
  
  <p><strong>A.</strong> Which part (SQL query or SSRS) costs more time (assuming that the task can be made in both SSRS and SQL) ?</p>
  
  <p><strong>B.</strong> What are the guidelines, if any, on which I should base a decision when having a dillema where to execute the given situation?</p>