Peter Brinkhaus (2/2/2010)
Paul, nice solution! However, the first day of the month is missing. Either subtract 1 from DayOffset.n as the parameter for the dateadd function or use a zero-based DayOffset (0-30) will fix it.
Darn it!!! :w00t:
Fixed - thanks for the great catch!
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi