title: How can I create a cumulative report of data with SQL?
body: <p>I have this table DDL:</p>
  
  <pre><code>CREATE TABLE [dbo].[Audit] (
      [AuditId] INT              IDENTITY (1, 1) NOT NULL,
      [Entity]  INT              NOT NULL,
      [Action]  INT              NOT NULL,
      [Id]      UNIQUEIDENTIFIER NULL,
      CONSTRAINT [PK_Audit] PRIMARY KEY CLUSTERED ([AuditId] ASC)
  );
  </code></pre>
  
  <p><strong>Update</strong> - I added the missing SQL here. Sorry about that</p>
  
  <p>What I did was create a SQL report using this SQL that would show me how much activity there was each day:</p>
  
  <pre><code>select [col1] = CONVERT(VARCHAR(10), DATEADD(HOUR, 8, a.date), 101) ,
         [Col2] = convert(varchar, count(*))
  from Audit a
  group by CONVERT(VARCHAR(10), DATEADD(HOUR, 8, a.date), 101)
  order by CONVERT(VARCHAR(10), DATEADD(HOUR, 8, a.date), 101) desc
  </code></pre>
  
  <p>The output looks like this:</p>
  
  <pre><code>col1        Col2
  03/05/2017  1
  03/04/2017  20
  03/03/2017  10
  03/02/2017  5
  03/01/2017  10
  </code></pre>
  
  <p>What I now need to do is to create a SQL select that shows me a cumulative value and not the count. So I need SQL that clould create a report that would show this</p>
  
  <pre><code>col1        Col2
  03/05/2017  46
  03/04/2017  45
  03/03/2017  25
  03/02/2017  15
  03/01/2017  10
  </code></pre>
  
  <p>Does anyone have any idea as to how I can modify my SQL to create this type of a report?</p>
  
  <p>Note that I am really looking for a one command solution as it is executed from .net framework and if there are multiple commands in the solution I think I would need to work out how to put this into a stored procedure somehow. </p>