title: select sum of a column between two dates
body: <p>i want <code>select</code> sum of <code>p_amount</code> every day on <code>Payments</code> table taht <code>p_date</code> between <code>@startdate</code> and <code>@enddate</code></p>
  
  <pre><code>CREATE TABLE [dbo].[tbl_Payments](
      [p_id] [bigint] IDENTITY(100000,1) NOT NULL,
      [p_amount] [int] NOT NULL,
      [p_status] [tinyint] NOT NULL,
      [p_date] [datetime] NOT NULL,
      [p_creditor] [int] NOT NULL,
      [p_debtor] [int] NOT NULL,
      [p_type] [int] NOT NULL,
   CONSTRAINT [PK_tbl_Payments] PRIMARY KEY CLUSTERED )
  </code></pre>
  
  <p>i want get like follow</p>
  
  <pre><code>sum                     day
  ---------------------------------
  30                 2013-07-01
  40                 2013-07-02
  ...                 ....
  10                 2013-07-19
  </code></pre>