Popular Posts

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

Tuesday, October 17, 2017

Code for 'week to date' DATETIME() mine is displaying previous weeks

SQLServerCentral » Latest topics
Code for 'week to date' DATETIME() mine is displaying previous weeks
[code language="sql"](Invoice_Exceptions.DateTime >= DATEADD(dd, DATEDIFF(dd,'17530101', GETDATE()) / 7 * 7 - 7, '17530101')) AND (Invoice_Exceptions.DateTime <= DATEADD(dd, DATEDIFF(dd,'17530101', GETDATE()

No comments: