Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by a varying # of days
Message
General information
Forum:
Microsoft SQL Server
Category:
Scripting
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01514570
Message ID:
01514573
Views:
49
First, I strongly recommend creating an external date calendar table (like a date dimension that you'd see in many data warehouse reporting applications). This will greatly increase your ability to query by different data attributes (day, week end date, month, quarter, year, epoch, etc.)

As you can add any type of date attribute to this table, it would even allow you to adjust for seaonality. (e.g. summarizing sales by Lent week 1 in 2009 versus Lent Week 2 in 2010)
Previous
Reply
Map
View

Click here to load this message in the networking platform