title: Sum a value in SSRS Reports based on date range
body: <p>I'm trying to sum a field value in an SSRS report based on a date range field in the same dataset, but have had no luck. So far this is what I've come up with. I've scoured the forums with no luck. Any help would be greatly appreciated. </p>
  
  <pre><code>= sum( iif(
              datediff("d",Fields!Calculated_DueDate.Value.value,today())&gt;=31
      AND
        (datediff("d",Fields!Calculated_DueDate.Value,today())&lt;62
           AND (Fields!Calculated_InvoiceBal.Value.value&gt;0 ),
           Fields!Calculated_InvoiceBal.value,0)))
  </code></pre>
  
  <p><code>Calculated_DueDate</code> is my date field and
  <code>Calculated_InvoiceBal</code> is the field I want to sum</p>