title: How to get the last week date from Sunday to Saturday
body: <p>I have the following table:</p>
  
  <pre><code>Date          Value
  4/13/2014     25
  4/14/2014     35
  4/15/2014     30
  4/16/2014     25
  4/17/2014     21
  4/18/2014     20
  4/19/2014     42
  4/20/2014     54
  4/21/2014     44
  4/22/2014     47
  4/23/2014     48
  4/24/2014     34
  4/25/2014     32
  4/26/2014     18
  4/27/2014     20
  4/28/2014     32
  4/29/2014     34
  </code></pre>
  
  <p>Which updates daily.</p>
  
  <p>How can I have a SQL query which adds the total <code>Value</code> from last week (Sunday-Saturday)?</p>
  
  <p>In this case, the Sunday is 4/20 and Saturday is 4/26.</p>
  
  <p>I currently have the following query which gets the week from this week:</p>
  
  <pre><code>SELECT * , DATENAME(WEEKDAY, Date) AS [DAY], CAST(CONVERT(VARCHAR(12), DATEADD(DAY , 7-DATEPART(WEEKDAY,GETDATE()),GETDATE()), 110) AS DATE) AS 'WeekEnding'
  FROM [database].[dbo].[table]
  WHERE Date &gt;= cast(dateadd(day,1-datepart(dw, getdate()), getdate()) as date)
  --SUNDAY to SATURDAY
  </code></pre>