Popular Posts

SQLblog.com - The SQL Server blog spot on the web

Monday, October 23, 2017

Possible to add a Total for Amount at the end of each day?

SQLServerCentral » Latest topics
Possible to add a Total for Amount at the end of each day?
[code language="sql"]DECLARE @Yesterday DATETIME = DATEADD(DAY,-1,CAST(GETDATE() AS DATE));
DECLARE @PeriodStart DATETIME = DATEADD(DAY,-6,@Yesterday),
   @PeriodEnd DATETIME = CAST(GETDATE() AS

No comments: