title: divide two table value in SSRS
body: <p>I´ve got two tables in my Report:</p>
  
  <p><a href="https://i.stack.imgur.com/fOjBC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fOjBC.png" alt="enter image description here"></a></p>
  
  <p>I would like to divide the value from Scrap with the value from Table Total</p>
  
  <p>--> (16227 / 425841) * 100</p>
  
  <p>This is the code:</p>
  
  <pre><code>Select date as Datetime, tevent.name as Event, SUM(value) as sum
  
      from tCount inner join tEvent ON tCount.eventid = tevent.id
               where Name in ('Drive  Fast', 'Drive Slow')
                 and date &gt; getdate() -1
                 and tevent.Name in ('E01','E02','E03','E04','E05','E06','E07','E08')
             and CalName = 'Drive'
  </code></pre>
  
  <p>The sum of these: 'E01','E02','E03','E04','E05','E06','E07','E08', I did it in the report like this: Sum(Fields!E01.Value+Fields!E02.Value+Fields!E03.Value+...</p>
  
  <p>And for the other table it looks like this:</p>
  
  <pre><code>Select date as Datetime, tevent.name as Event, SUM(value) as sum
  
          from tCount inner join tEvent ON tCount.eventid = tevent.id
                   where Name in ('Drive Normal')
                     and date &gt; getdate() -1
                     and tevent.Name in ('E01','E02','E03','E04','E05','E06','E07','E08')
                 and CalName = 'Drive'
  </code></pre>
  
  <p>And I must do a division of this two statements.
  But if I put in the Scrap Expression the value from Total then the result is wrong. Hope you can help me.</p>