title: Rounding within avg() over () clause not working - SQL Server
body: <p>Does anybody know how to rewrite this 7-day moving average query in SQL Server, so that I get the value rounded 2 decimal places after the comma?</p>
  
  <p>Current query:</p>
  
  <pre><code>SELECT round(avg(amount) OVER (
              ORDER BY DATE ASC rows BETWEEN 6 preceding
                      AND CURRENT row
              ), 2) average_amount
  </code></pre>
  
  <p>Current output:</p>
  
  <pre><code>120.00
  121.00
  120.00
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>120.11
  121.18
  120.20
  </code></pre>
  
  <p>What am I missing here?</p>