|
Posted by Stu on 10/24/05 04:32
This would be easy if your business used calendar quarters instead;
can't you make them change? <G> You could then group by
DATEPART(Quarter, DateSample)
Since that's not likely, a solution might be to use a calendar table
that takes a key Date and maps it to the appropriate quarter, eg:
CREATE TABLE Calendar (DateKey smalldatetime, PeriodQuarter int....
(other columns))
INSERT INTO Calendar (DateKey, PeriodQuarter)
SELECT '9/1/2005', 2
UNION ALL
SELECT '9/4/2005', 3
etc
You could then join and group on the PeriodQuarter value.
Just an idea.
Stu
[Back to original message]
|